How to Boot an EC2 With a WebServer Setup


Create a new AWS EC2 instance, and set the User Script to the following:

#!/bin/bash
sudo su
yum update -y
yum install -y httpd.x86_64
systemctl start httpd.service
systemctl enable httpd.service
echo "<h1>Serving from $(hostname -f)</h1>" > /var/www/html/index.html