Last active
September 12, 2018 13:51
-
-
Save abhilash1in/4fb699e472e9828af5d85e397c3a4616 to your computer and use it in GitHub Desktop.
Simple Webserver for Amazon Linux AMI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
yum update -y | |
yum install httpd -y | |
chkconfig httpd on | |
service httpd start | |
echo "Private IP:" > /var/www/html/index.html | |
curl http://169.254.169.254/latest/meta-data/local-ipv4 >> /var/www/html/index.html | |
echo "Public IP:" >> /var/www/html/index.html | |
curl http://169.254.169.254/latest/meta-data/public-ipv4 >> /var/www/html/index.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment