Skip to content

Instantly share code, notes, and snippets.

@abhilash1in
Last active September 12, 2018 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhilash1in/4fb699e472e9828af5d85e397c3a4616 to your computer and use it in GitHub Desktop.
Save abhilash1in/4fb699e472e9828af5d85e397c3a4616 to your computer and use it in GitHub Desktop.
Simple Webserver for Amazon Linux AMI
#!/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