View Full Version : VHost problem

03-18-2007, 12:10 PM
I have set-up a new VPS on which I'm running my domain ( www.giochinternet.com ). So I set-up a vhost because I need to use this server for other domains as well. For now the only domain and vhost is the main domain ( giochinternet.com ).

Today searching my domain on google I found someone has redirected two of his own domains ( carlfretwell.com and osfreefall.com ) on my IP and my web server is obviously serving the home page of giochinternet.com even when it receives requests for carlfretwell.com and osfreefall.com.

Is there a method to instruct the web server to not serve requests for which the Host header parameter value is not in the list of his vhosts?

I'm using Nginx as web server, but searching on the Apache website I found Apache also serves the first vhost for all unmatched Host header parameter values.

Thanks in advance

10-16-2007, 10:13 PM
You could create a vhost for those domains and make the docroot go somewhere else. Or redirect it to an error page or something. You could use .htaccess to do that as well.

11-24-2008, 01:48 AM
You should add the entry :

NameVirtualHost ip:80

for the ip for the main domainname on the server, so that multiple domains can be hosted on the ip. And preferrably, the first virtualhost should be a default virtualhost with the document root pointed to the apache test page or a custom welcome page like below :

< VirtualHost ip>
Servername anyname
DocumentRoot /usr/local/apache/htdocs/

11-25-2008, 02:50 AM
That is old thread. Closed

03-09-2009, 06:10 AM
That is old thread. Closed

05-15-2009, 03:04 AM
I have a virtualhost set up for http://example.com and my hosts file redirects that url to my local ip.iiiiiiiiii

When I enable the inclusion of the httpd-vhosts file, although the example.com site loads, if I go to localhost I no longer get a directory list at localhost..........

02-11-2011, 02:36 AM
thats a really old thread to post here