Specifying the default domain when accessing via shared IP

airbeck

Registered
Sep 12, 2006
1
0
151
Hey,

I don't know if this topic has come up here before, but I have a reseller customer that has all his domains on a single shared IP. He wanted to know if there was a way to set which domain on that IP will come up when accessing it by putting the IP into a browser, like http://xxx.xxx.xxx.xxx

I understand this is determined by which domain on that IP comes first in the httpd.conf file.

What I don't know is how to change which domain comes first in that file. Just editing it won't work because it will just be overwritten the next time the file is generated. So the question is whether there is a way to make cPanel generate that file in any particular order.

So has anyone come across this issue before, or have any ideas?

Thanks,

Aaron
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,466
31
473
Go on, have a guess
I'm not aware of a way to do that for it to survive the cPanel configuration scripts. It would be a handy feature if this could be done easily (perhaps in the IP Functions section of WHM). I'd suggest you log an enhancement request in http://bugzilla.cpanel.net if there isn't one already and then post the link to it back here so others can vote for it.
 

jeroman8

Well-Known Member
Mar 14, 2003
410
0
166
been looking in the templates files but can't find any vhost records there where you can change the order. Tested to change the order directly in httpd and the run destiller but it did not save it.

So anyone know how to change the order domains is listed in httpd.conf please let us know.
 

electric

Well-Known Member
Nov 5, 2001
786
10
318
I agree that this would be a nice feature to have available in the WHM, so we (and resellers) can easily set the "default" website for a shared IP.

I looked in the bugzilla system, but did not see this anywhere.. does a request already exist for it? Seems like a pretty common "problem", so I figured there would already be a feature request for it I can add my vote to...

??
 

FreedomBI

Well-Known Member
Jul 7, 2008
65
0
56
I accomplished this by copying entries to pre_virtualhost_global.conf. If you want a different default domain for the entire box (ie, for unallocated IP's), you need to edit the templates in /var/cpanel/templates/apache2. Make sure to read all of the comments at the top of main.default.