Quick way to setup AWS web server.
Step 1. AWS console configuration to setup AWS web server.
1. On the services Menu, Click on EC2.
2. Click on Launch Instance.
3. Please select Following mentioned details.
a.Select Amazon Linux AMI as below:
b. On the next step Choose an Instant Type Page, confirm t2.micro is selected and then click Next:Configure Instance Details.
c. On the next step “Configure Instance Details” Do not change anything unless its very much required.
d. On the Next Step “Add Storage” Keep the default 8 GB General Purpose SSD option.
e. On the Next step “Add Tags” . Click on Add tag button and under “Key” value enter Name and for Value column enter “Webserver” as below:
Now Click Next on Configure Security group Button.
f. In this tab along with ssh port range 22 add one more rule for http port 80, so that we can access http web server index.html webpage as below:
- Click Add rule Button
- In type drop down select “HTTP” as below and click Review and Launch button:
g. In the next step review all the settings and click Launch button.
h. In the next step , select key Pair if you have any existing one other wise select new one. Click on I acknowledge check box and click Launch Instances Button.
h. Now select Instance and note down the “Public DNS (IPv4)” value. This is required for login on EC2 instance as well as accessing the webserver.
Now next we need to install webserver program on server for that follow below steps.
Step 2. Ec2 configuration to setup AWS web server.
a. Login to EC2 instance. If you don’t know how to login to Ec2 instance Please check this link.
b.Now install httpd, php, mysql and php-mysql packages required to “setup AWS web server”.
# yum -y install httpd php mysql php-mysql
b. Turn on http service using chkconfig so that httpd will started automatically after reboot of the server.
#chkconfig httpd on
c. Start the http or web server service.
# /etc/init.d/httpd start Starting httpd: [ OK ] #
d. Now we need to make sample index.html file so that it gets displayed whenever we tried to access web server.
cd /var/www/html/ vi index.html
and insert below contents in it and do save and quit.
# cat index.html <html> <head> <title>UxTechno</title> </head> <body> <p><b>Welcome to LinuxRoutes.com Webserver!!!!</b></p> </body> </html>
Now try to access the web page using the DNS address noted down during step1-sub-step h. You will get below message in browser.
Above message confirms that we have successfully setup AWS web server.