May 20, 2023
Paste the below code in User Data while creating the Linux Server
It will install apache server and an index.html will be created.
Put the server ip address in browser, you will find the server is up and running and the index.html file will be accessable.
!/bin/bash
sudo su
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