I have an empty CentOS 6.3 box. I need to run multiple websites from this server. Things that I have done so far are:
- Installed Apache, MySQL, PHP and PHP modules by following this article.
- I created a test file index.html inside the /var/www/html/ folder and tried to visit the default site by pointing my browser to the server's IP. But it didn't show anything.
- I commented the line "DocumentRoot /var/www/html" inside the httpd.conf file and added Virtualhost settings as:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName abc.com
DocumentRoot /var/www/vhosts/abc.com
DirectoryIndex index.php
<Directory "/var/www/vhosts/abc.com">
DirectoryIndex index.php
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
Note abc.com above is the hostname of my server and I connect to the server as [email protected]
- I created folders /vhosts/abc.com and placed a file index.php in it
- I then restarted the server using service httpd restart
Pointing my browser to either the server's IP or abc.com, shows me a "Page cannot be displayed". If I try to check /var/log/httpd/access_log or /var/log/httpd/error_log, it shows me nothing.
UPDATE: My /etc/hosts file is like:
127.0.0.1 localhost.localdomain localhost
108.175.9.103 abc.com
and /etc/sysconfig/network file is:
NETWORKING=yes
HOSTNAME=localhost.localdomain
How do I check where does the problem lie ? What possibly could be wrong here ?
Update2: My iptables file looks like:
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
After the las line (after COMMIT), I tried to add:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
But a restart of the iptables service throws an error.