Viewing site by IP shows default cPanel page

rpertiet

Member
Apr 21, 2007
14
0
151
When I view my site by IP address I get this page:

Great Success !
Apache is working on your cPanel® and WHM™ Server

How do I change that to correctly show my site instead of the cPanel page? When I view the site by domain name everything works correctly.

WHM 11.11.0 cPanel 11.15.0-C17853
CENTOS Enterprise 4.5 i686 on standard - WHM X v3.1.0

Thanks!
 

darren.nolan

Well-Known Member
Oct 4, 2007
257
0
66
Are you by chance using the server's shared IP when trying to view this way? Which version of apache are you using? Version 1 and 2 behave slightly differently when accessing IPs directly (especially the shared IP).
 

rpertiet

Member
Apr 21, 2007
14
0
151
Yes, it turns out that when the host setup my dedicated machine the IP is still set to a shared IP. Can I change this to a dedicated IP and still use the same IP address? If so, how? And Apache 1.3
 

darren.nolan

Well-Known Member
Oct 4, 2007
257
0
66
What he said...

Lol - Thanks Linux-Image.

EDIT: How did my post appear before yours?? lol.
 
Last edited:

linux-image

Well-Known Member
Jun 8, 2004
1,190
1
168
India
cPanel Access Level
Root Administrator
open your apache configuration and remove the virtualhost entry for the IP address that has the documentroot set as /usr/local/apache/htdocs and restart apache.

the main ip of the server is always a shared ip; and just that you know apache serves the content of the documentroot of the first match for the IP address in case you access via ip. so make sure that you have the virtualhost entry for the domain you want to show, as the first entry for the IP at httpd.conf. hope i am clear.
 

sebby

Well-Known Member
Jun 15, 2004
70
0
156
Canada
cPanel Access Level
Root Administrator
open your apache configuration and remove the virtualhost entry for the IP address that has the documentroot set as /usr/local/apache/htdocs and restart apache.

the main ip of the server is always a shared ip; and just that you know apache serves the content of the documentroot of the first match for the IP address in case you access via ip. so make sure that you have the virtualhost entry for the domain you want to show, as the first entry for the IP at httpd.conf. hope i am clear.
What would be the equivalent procedure for Apache 2.2.x to prevent the changes to be overwritten when recompiling.

/Seb
 

darren.nolan

Well-Known Member
Oct 4, 2007
257
0
66
/usr/local/cpanel/bin/apache_conf_distiller --update

Alternatively you could make use of the apache includes - but Im not the best person to ask about that - I've not had a need for it yet.