main shared IP showing user's site

Stellar

Registered
Jul 28, 2004
4
0
151
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.
 
Last edited:

nerdzoll

Well-Known Member
Oct 4, 2004
105
0
166
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
 

Karthick

Member
Oct 12, 2004
11
0
151
Put this in httpd.conf and restart Apache

NameVirtualHost x.x.x.x:80

Where x.x.x.x is the shared IP.
 

Stellar

Registered
Jul 28, 2004
4
0
151
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 [email protected]
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.