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!

Server IP Address

Discussion in 'General Discussion' started by anoop0509, Feb 18, 2014.

  1. anoop0509

    anoop0509 Member

    Joined:
    Feb 17, 2007
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    151
    Hello

    we have a cpanel server when we type the public IP of the website, it shows the first website of client hosted on our server. We want this to change to show the website of company or a default website we want to show instead of showing customer website on the server IP.

    Please advice how this can be done.

    anoop
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    Is this a dedicated IP address or is it the main shared IP address of the server? If it's the main shared IP address, then you should be able to ensure the default VirtualHost entry is the first one that appears for the main shared IP address with the following command:

    Code:
    /scripts/rebuildhttpdconf
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. anoop0509

    anoop0509 Member

    Joined:
    Feb 17, 2007
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    151
    Hello

    It is a Shared IP address. how do I ensure that default entry is for the server hostname instead of client site. Do I manually put the entry in httpd.conf ? and then run the rebuild script ?

    Anoop
     
  4. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    834
    Likes Received:
    29
    Trophy Points:
    178
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    There are a few ways to do this, but what I see most of my clients doing is as followings:

    Code:
    cd /var/cpanel/templates/apache2/
    cp main.default main.local

    Then edit the default vhost entry in main.local to point to the documentroot of the website you want it to load. You'll recognize it because it points to /usr/local/apache/htdocs. Make sure to change the user/group in that entry too.

    Then:

    Code:
    /scripts/rebuildhttpdconf
    service httpd restart
    
    You don't want to edit httpd.conf manually because your changes will be overwritten during cPanel updates.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. anoop0509

    anoop0509 Member

    Joined:
    Feb 17, 2007
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    151
    thanks, the solution worked properly.
     
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