The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

main shared IP showing user's site

Discussion in 'General Discussion' started by Stellar, Dec 1, 2004.

  1. Stellar

    Stellar Registered

    Joined:
    Jul 28, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    First off, is there any way to make the main shared IP different from the one I use to access the WHM? This isn't' a problem, just a preference.

    The actual problem here is that if someone looks up the IP for a site, then visits that IP, they will see the website of a different client on our server. This also happens if someone visits mail.domain.com via http. I would much rather return a "There is no website configured at this address" page in this case.

    Thank you.
     
    #1 Stellar, Dec 1, 2004
    Last edited: Dec 1, 2004
  2. nerdzoll

    nerdzoll Well-Known Member

    Joined:
    Oct 4, 2004
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Hey,
    THere is a way to do this (had to get help from the cpanel guys) but it entails creating virtual hosts in the .htaccess files.. i can try to rustle up the details if you would like... PM me.

    But by creating this addition in your .htaccess file, if there is no website configured at that addy it will just come up with a cpanel page stating so.

    Cheers
    NErdzoll
     
  3. Karthick

    Karthick Member

    Joined:
    Oct 12, 2004
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Put this in httpd.conf and restart Apache

    NameVirtualHost x.x.x.x:80

    Where x.x.x.x is the shared IP.
     
  4. Stellar

    Stellar Registered

    Joined:
    Jul 28, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for your help. I peiced together what to do based on your suggestions.

    The
    Code:
    NameVirtualHost x.x.x.x:80
    was already in my httpd.conf.
    I needed to add
    Code:
    <VirtualHost 123.123.123.123>
    ServerAlias 123.123.123.123
    ServerAdmin admin@domain.com
    DocumentRoot /usr/local/cpanel/htdocs
    BytesLog domlogs/123.123.123.123-bytes_log
    ServerName 123.123.123.123
    CustomLog domlogs/123.123.123.123.com combined
    </VirtualHost>
    to httpd.conf, and I was good to go.
    I think this would be a good thing to have set by default. It'd weird out some nosy user if he found out his site's IP, browsed to it, and saw someone else's site.
     
  5. maxisgamer.net

    maxisgamer.net Registered

    Joined:
    Dec 8, 2004
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Once you edit the config, restart Apache, either from shell or from WHM. To start from shell, type:

    From WHM, go to restart services and click HTTPD.

    Merry Christmas People!

    Aaron Reilly
    Server Admin
    www.maxisgamer.net
     
Loading...

Share This Page