acenetryan

Well-Known Member
PartnerNOC
Aug 21, 2005
197
1
168
We have a Reseller who recently purchased a dedicated IP for his main reseller account and wants all of his clients to share this IP as his main shared.

He also wants his clients to be able to access their accounts using:

http://<NEWDEDICATEDMAINSHAREDIP>/~<USERNAME>/

This was originally failing to function and we noticed that when we disabled mod_userdir it worked without a problem. We then reeenabled mod_userdir and attempted to allow this to continue functioning by exempting his main domain from the protection. However, this did not correct it.

When tailing the Apache logs, we noticed that another of his users was instead being accessed when other users attempt to load the IP URL. We checked the Apache conf and noticed that this user is the one which has their VirtualHost on the new dedicated IP appear first in the httpd.conf.

We disabled mod_userdir on this user instead and now the IP URL access works fine.

The problem is that now this user's VirtualHost entry is used when other users load the IP URL and accesses are being logged in this user's domlogs.

So it seems that along with the ability to enable a Reseller's main shared IP, there should also be an option to either:

A) Add a new "generic" VirtualHost entry to the top of the httpd.conf for these main shared Reseller IPs just as there is one for the server's hostname.

or

B) Force the Reseller's Main Domain's VirtualHost entry to occur first within the httpd.conf.

or

C) Allow us to select which entry should occur first within the httpd.conf.


Right now, I'm looking for how cPanel currently dictates the order in which VirtualHosts are added to the httpd.conf. It does not appear to be in Alphabetical order. Manually adjusting the settings in the backend so that the Reseller's main domain is added first would suffice as a temporary solution for now.
 

acenetryan

Well-Known Member
PartnerNOC
Aug 21, 2005
197
1
168
Recently, we've discovered several entries in the top of our httpd.conf for resellers with shared IPs (basically, option A from my first post). Entries similar to:

Code:
<VirtualHost [RESELLERSHAREDIP]:80>
    ServerName [SERVERHOSTNAME]
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin [CONTACTEMAIL]
    <IfModule mod_suphp.c>
        suPHP_UserGroup nobody nobody
    </IfModule>
</VirtualHost>
This works great and sufficiently addresses the issue. However, we've noticed only certain resellers get this entry added and we have a lot more resellers using a shared IP for their accounts. Anyone know why these default httpd.conf entries were created for some resellers and not for others?