Results 1 to 7 of 7

Thread: VHost problem

  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    1

    VHost problem

    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

  2. #2
    Junior Member
    Join Date
    Oct 2007
    Posts
    9
    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.

  3. #3
    Junior Member
    Join Date
    Oct 2008
    Posts
    10
    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>
    ------------
    hzSari | HostingZoom.com
    ModVPS.com | ResellerZoom.com
    Power Speed Reliability

  4. #4
    Guest Moderator ~ServerPoint~'s Avatar
    Join Date
    Nov 2007
    Posts
    1,846
    That is old thread. Closed
    ServerPoint.com - a true hosting company offering online presence solutions since 1998
    Web Hosting, colocation, dedicated servers, Virtual Private Server (VPS) hosting
    Wholly owned multi homed network, servers and facilities

  5. #5
    Senior Member
    Join Date
    May 2008
    Posts
    100
    That is old thread. Closed
    In the middle of difficulty lies opportunity - Albert Einstein
    Audio Production Degrees

  6. #6
    Senior Member
    Join Date
    May 2009
    Posts
    179
    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..........

  7. #7
    Senior Member
    Join Date
    Sep 2010
    Posts
    932
    thats a really old thread to post here

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

  Find Web Hosting      
  Shared Web Hosting UNIX & Linux Web Hosting Windows Web Hosting Adult Web Hosting
  ASP ASP.NET Web Hosting Reseller Web Hosting VPS Web Hosting Managed Web Hosting
  Cloud Web Hosting Dedicated Server E-commerce Web Hosting Cheap Web Hosting


Premium Partners:


Visit forums.thewebhostbiz.com: to discuss the web hosting business, buy and sell websites and domain names, and discuss current web hosting tools and software.