main virtualhost for my domain overrides a subdomain i setup in cpanel

nsanden

Member
May 11, 2010
8
0
51
I have an account I setup as domain.com. I then later added a subdomain in cpanel of * for that domain and added the appropriate wildcard dns.

Looking in httpd.conf I now see this:

<VirtualHost IP>
ServerName domain.com
ServerAlias *.domain.com www.domain.com
DocumentRoot /home/domain/public_html
</VirtualHost>

...

<VirtualHost IP>
ServerName *.domain.com
ServerAlias *.domain.com
DocumentRoot /home/domain/public_html/somewhere
</VirtualHost>

Obviously in order for the 2nd virtual host to work correctly I need the first one to not use a wildcard serveralias. Is this possible without easyapache reverting it back every time or is there a better way to achieve what i'm trying to do?

Thanks for any help!
 

nsanden

Member
May 11, 2010
8
0
51
Figured it out!

In case someone else has this problem.
Simply needed to edit: /var/cpanel/userdata/{user}/main

and remove the *domain.com parked domain.

then rebuild httpd.conf:

/usr/local/cpanel/bin/apache_conf_distiller --update
/scripts/rebuildhttpdconf