Tuesday, March 10, 2015

Setup static web site on AWS EC2

Allow HTTP 80 port redirection from public IP to your private server, by default only 22 port is setup:


sudo yum install mc


desable SElinux
/etc/selinux/config
SELINUX=disabled


restart SERVER:
reboot


vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
service iptables restart


http://dev.antoinesolutions.com/apache-server

How to install Apache Server on CentOS, RedHat, Linux

Install Apache HTTP Server
yum install httpd
Note: This is typically installed with CentOS by default

How to configure Apache Server on CentOS, RedHat, Linux

Set the apache service to start on boot
chkconfig --levels 235 httpd on
Enable name-based virtual hosting on port 80
Open the httpd configuration file located at /etc/httpd/conf/httpd.conf

ErrorLog /www/logs/error_log
CustomLog /www/logs/access_log combined
ServerName 54.164.21.75:80
DocumentRoot "/www"

Save the file
Restart the Apache HTTP Server daemon
service httpd restart



 In Browser :
http://54.164.21.75/ should show apapche welcome page


To make Authentication for one user by password:
http://www.cyberciti.biz/faq/howto-setup-apache-password-protect-directory-with-htaccess-file/
http://weavervsworld.com/docs/other/passprotect.html

No comments:

Post a Comment