Thanks Tom for your answer, But it's not working for the IP-based part, what is the default vhost for IP-based vhost?
Also i am using IP-based because of SSL on "one" Name-based vhost and SSL the Ip-based vhost. Regards, Tom Evans-3 wrote: > > On Thu, Dec 1, 2011 at 9:34 AM, ipmanux <[email protected]> wrote: >> >> Dear all, >> >> I am using RHEL with HTTPD+TOMCAT, I configured 4 VHOSTs on the same >> server >> >> -3 VHOST (named-based) >> 1st vhost: www.abc.com >> 2nd vhost: www.def.com >> 3rd vhost: www.ghi.com >> >> -1 VHOST(IP-based) >> www.klm.com >> >> My DNS record are for the 3 VHOST (named-based) pointing to >> 192.168.1.2 >> and for the VHOST(IP-based) pointing to an alias 192.168.1.3 >> >> In case someone create a DNS entry pointing to one of my 2 IP address for >> example: >> www.someone.com -> 192.168.1.2 >> >> How to config Apache to not respond or redirect to a error page when an >> end >> user browse this URL:www.someone.com ? >> > > The first vhost for a particular vhost spec (eg, the first > <VirtualHost *:80> or the first <VirtualHost 1.2.3.4:80>, depending on > what you have for NameVirtualHost) is the default vhost. When a > request comes in for a domain name that is not served by any of your > vhosts, it will be served from the default vhost. > > Hence, if you want unknown domains to error, your first vhost should > handle this. Eg: > > <VirtualHost *:80> > # The default/error vhost, no ServerName required > DocumentRoot /var/www/sites/error > </VirtualHost> > > <VirtualHost *:80> > ServerName foo.com > </VirtualHost> > > Cheers > > Tom > > -- View this message in context: http://old.nabble.com/Virtual-host-and-DNS-record-tp32890382p32902970.html Sent from the Apache HTTP Server - Dev mailing list archive at Nabble.com.
