anoop0509

Member
Feb 17, 2007
8
0
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
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.
 

anoop0509

Member
Feb 17, 2007
8
0
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
 

vanessa

Well-Known Member
PartnerNOC
Sep 26, 2006
833
28
178
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.