I have 2 domain names (myvent.com & pmtoolkit.com) that I am trying to set up on my Apache 2.0 server which is running on a Red Hat Linux 9 installation.
The DNS servers of my ISP point both domain names to the static IP address of my Linux server - 208.181.164.164
Here's what I want to do:
If a user enters
http://208.181.164.164 I want the server to serve an index.html page from the DocumentRoot which is "/var/www/html".
If a user enter
http://www.myvent.com I want the server to serve a page from the myvent.com VirtualHost DocumentRoot which is "/var/www/html/vent/phpBB"
If a user enters
http://www.pmtoolkit.com I want the server to serve a page from the pmtoolkit.com VirtualHost DocumentRoot which is "/var/www/html/pmtoolkit"
Here's what happens:
If a user enters
http://www.myvent.com, a page from this VirtualHost's DocumentRoot is served.
If a user enters
http://www.pmtoolkit.com, a page from this VirtualHost's DocumentRoot is served.
If a user on the local LAN enters
http://192.168.50.1 (this is the local IP address of the linux server), a page from the DocumentRoot "/var/www/html" is served.
However, if a user enters
http://208.181.164.164, a page from the VirtualHost pmtoolkit.com's DocumentRoot ("/var/www/html/vent/phpBB") is served instead of a page from the DocumentRoot "/var/www/html"
Could someone please help me solve this.
I have listed part of my httpd.conf file below:
Thanks,
--Rajan
NameVirtualHost 208.181.164.164
# Where do we put the lock and pif files?
LockFile "/var/lock/httpd.lock"
CoreDumpDirectory "/etc/httpd"
# Defaults for virtual hosts
# Logs
#
# Virtual hosts
#
# Virtual host Default Virtual Host
<VirtualHost *>
ServerSignature email
DirectoryIndex index.php index.html index.htm index.shtml
LogLevel warn
HostNameLookups off
</VirtualHost>
# Virtual host myvent.com
<VirtualHost myvent.com>
DocumentRoot /var/www/html/vent/phpBB
ServerAdmin
rajan@myvent.com
ServerName
www.myvent.com
ErrorLog /var/log/httpd/myvent/myvent_error_log
CustomLog /var/log/httpd/myvent/myvent_access_log common
<Directory "/">
AllowOverride none
</Directory>
</VirtualHost>
# Virtual host pmtoolkit.com
<VirtualHost pmtoolkit.com>
DocumentRoot /var/www/html/pmtoolkit
ServerAdmin
rajan@pmtoolkit.com
ServerName
www.pmtoolkit.com
ErrorLog /var/log/httpd/pmtoolkit/pmt_error_log
CustomLog /var/log/httpd/pmtoolkit/pmt_access_log common
<Directory "/">
AllowOverride none
</Directory>
</VirtualHost>