Last active
August 13, 2019 21:12
-
-
Save tylerapplebaum/62b2602253e1582d09ea4da7c30413cc to your computer and use it in GitHub Desktop.
Bootstrap for Amazon Linux 2 EC2 instances
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 | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pairs with this Gist: https://gist.github.com/tylerapplebaum/98a940c312724ae6a0838d43afc2a592