-
-
Save leaderdevops/6c157eafe68fc9a10ea8968076e1eea2 to your computer and use it in GitHub Desktop.
EC2 User data: install Apache web server for Amazon Linux 2 Image
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 | |
######################################## | |
##### USE THIS WITH AMAZON LINUX 2 ##### | |
######################################## | |
# get admin privileges | |
sudo su | |
# install httpd (Linux 2 version) | |
yum update -y | |
yum install -y httpd.x86_64 | |
systemctl start httpd.service | |
systemctl enable httpd.service | |
echo "Hello World from $(hostname -f)" > /var/www/html/index.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment