Creating Apache Web-Server on Linux EC2
- Create Amazon Linux AMI based EC2 instance, for help visit: Lab 1.1
- Login to your EC2 instance
- Elevate your privileges by doing
sudo su
- Do an update of your OS by running
yum update -y
- Let’s install apache for web-server by running
yum install httpd -y
- Next, we would need to start apache server by running
service httpd start
- For enable self-start of apache service on reboot, run
chkconfig httpd on
- Now let’s created some web-page in apache directory (/var/www/html) by running
echo "Hello World" > /var/www/html/index.html
- Now check default security group it should have port 80 allowed for anywhere
- Now copy the public IP of your EC2 instance and put it in your browser you should able to see “Hello World” webpage
- That’s it for this Lab, now you can delete this instance