Skip to content

Instantly share code, notes, and snippets.

@tylerapplebaum
Last active August 13, 2019 21:12
Show Gist options
  • Save tylerapplebaum/62b2602253e1582d09ea4da7c30413cc to your computer and use it in GitHub Desktop.
Save tylerapplebaum/62b2602253e1582d09ea4da7c30413cc to your computer and use it in GitHub Desktop.
Bootstrap for Amazon Linux 2 EC2 instances
#!/bin/bash
sudo yum install httpd
usermod -a -G apache ec2-user
sudo chown -R ec2-user:apache /var/www
sudo systemctl restart httpd.service
sudo systemctl enable httpd.service
public_ipv4=$(curl -s "http://169.254.169.254/latest/meta-data/public-ipv4")
sudo echo $public_ipv4 > /var/www/html/public-ipv4.txt
cd /var/www/html
curl -O https://gist.githubusercontent.com/tylerapplebaum/98a940c312724ae6a0838d43afc2a592/raw/85523ac76edf2c68ee7431839784dff4313b723a/index.html
sudo systemctl restart httpd.service
@tylerapplebaum
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment