Tuesday, July 19, 2016

AWS Simple Bootstrap Linux Web Server with Website

Bootstrapping in AWS enables developers and admins to pre-configure how a resource should be setup.  This short bash script can be added to the Advanced Configuration section of a Linux web server launch.

The bash script will do the following:

1. Install the Apache web server
2. Update the server
3. Copy the web site files from an S3 bucket
4. Start the web server

Bash Script:

#!/bin/bash
yum install httpd -y
yum update -y
aws s3 cp s3://YOURBUCKETNAMEHERE/index.html /var/www/html/
service httpd start
chkconfig httpd on



No comments: