Hi,
I was successful to set up virtual host on my Redhat Enterprise Linux 4 base on NameVirtualHost. I added two records in httpd.conf file and disable default virtual host like below:
# Virtual host Default Virtual Host
#<VirtualHost *>
# ServerSignature email
# DirectoryIndex index.php index.html index.htm index.shtml
# LogLevel warn
# HostNameLookups off
#</VirtualHost>
NameVirtualHost 70.182.xxx
<VirtualHost 70.182.xxx>
ServerName
www.abc.com
ServerAlias abc.com
DocumentRoot /var/www/html/abc
DirectoryIndex index.php index.html index.htm index.shtml
</VirtualHost>
<VirtualHost 70.182.xxx>
ServerName
www.bcd.com
ServerAlias bcd.com
DocumentRoot /var/www/html/bcd
DirectoryIndex index.php index.html index.htm index.shtml
</VirtualHost>
When user type
www.abc.com, the first virtual host is called and the second is called when user type
www.bcd.com. But when user type 70.182.xxx, the first virtual host is called. Why? How can I disable that and force user using URL instead of IP address?
Thanks