PDA

View Full Version : VHost problem



paolinox
03-18-2007, 01: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

ls_drew
10-16-2007, 11: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.

hzSari
11-24-2008, 02: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/
</VirtualHost>

~ServerPoint~
11-25-2008, 03:50 AM
That is old thread. Closed

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

Oracle
05-15-2009, 04: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..........

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