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.

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:
    1
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  3. anoop0509

    anoop0509 Member

    Joined:
    Feb 17, 2007
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    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:
    817
    Likes Received:
    22
    Trophy Points:
    18
    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.
     
  5. anoop0509

    anoop0509 Member

    Joined:
    Feb 17, 2007
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    thanks, the solution worked properly.
     
Loading...

Share This Page