chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
31
473
Go on, have a guess
You have to add a ServerAlias of *.domain.tld to the VirtualHost container. It will always override cPanel subdomain configurations. The only way around that is to place the subdomain VirtualHost containers before the main domains in httpd.conf.
 

anup123

Well-Known Member
Mar 29, 2004
889
1
168
This Planet
Hi Chirpy.

Would it be a good idea to go the mod_vhost_alias route if it's a mass virtual hosting with following added to httpd.conf (after a wildcarded DNS entry to a separate IP altogether for each of those domains with subdomain):

<VirtualHost *:80>
UseCanonicalName Off
VirtualDocumentRoot /home/.../.../%-1/%-2/%-3
</VirtualHost>

Any pitfalls?

TIA
Anup
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
31
473
Go on, have a guess
The advantage of using a wildcard ScriptAlias is that apache logs will be retained and so should the bandwidth monitoring. You would need to beef up that VirtualHost directive as you've quoted it to do the same, though. Other than that, whatever works best given the circumstances. Order within httpd.conf with any solution is critical though.