Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Do not return sites for domain that is not listed

Discussion in 'General Discussion' started by s2s, Mar 20, 2014.

  1. s2s

    s2s Member

    Joined:
    Nov 21, 2013
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    How do I correctly configure the server to not return any site for domains that are not explicitly listed in httpd.conf?

    At the minute our VPS returns one of our hosted packages for all sites, even if the domain is not listed in httpd.conf! This means any domain that points to our VPS IP gets served with one of our hosting packages - meaning Google is displaying the content of that hosting site under different domain names in SERP.

    I would like to:

    a) only return websites for domains that are explicitly defined in httpd.conf (do nothing for unconfigured domains pointed to our IP)

    b) configure the page/site displayed when visiting the VPS shared IP
     
  2. s2s

    s2s Member

    Joined:
    Nov 21, 2013
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I resolved this issue by adding the following code to the cPanel vhosts template (at the top):

    /var/cpanel/templates/apache2/vhost.local
    Code:
    <VirtualHost [% FOREACH ipblock IN vhost.ips %] [% ipblock.ip %][% END %]:8080>
       ServerName default-unauth-domain
       <Location />
         Order deny,allow
         Allow from googlebot.com
         Allow from 127.0.0.1
       </Location>
    </VirtualHost>
    This forces apache to deny requests to any domain name other than the name identified in the preceeding vhost config. It also adds the 'patch' into the cPanel template so that it get included each time apache config gets rebuilt (updates, etc.)
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,961
    Likes Received:
    1,821
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    I am happy to see you were able to resolve the issue. Thank you for updating us with the outcome.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice