Force using URL (ServerName) instead of IP address
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 |
Do these actually have two different IP's or use the same IP? In order to use two IP's for two virtual hosts, you need two different IP's or using the IP of the server will result in using the first virtual host or main configured Domain.
|
Quote:
|
All times are GMT -5. The time now is 09:28 PM. |