edigest

Active Member
Nov 24, 2010
44
0
56
S. Pole
cPanel Access Level
Root Administrator
I setup a global custom vhost configuration (following guidance in Changes Contained Within a VirtualHost Directive). Works great.

There is a problem with one item in the custom configuration on one domain. I tried to setup the vhost configuration for that domain using guidance in "Custom templates that will apply to a single virtual host" but the behavior in the "Custom templates that will apply to all virtual hosts" section is overriding the "single vhost" changes.

Is there a way to either remove a single domain from the "apply to all" configuration or to modify the single domain in such a way that removes or modifies the "apply to all" configuration for one domain?

If the question is too broad, I can post a specific example.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello :)

Have you tried leaving the "Custom template that will apply to all virtual hosts" in-place and then making the individual VirtualHost change directly in the httpd.conf file? You would then run the Apache distiller to preserve that change.

Thank you.
 

edigest

Active Member
Nov 24, 2010
44
0
56
S. Pole
cPanel Access Level
Root Administrator
I did try creating a custom vhost for the domain, but had not tried editing /usr/local/apache/etc/httpd.conf directly.

Your solution does work, though.

To anyone else for whom this info might help, you will have to redo the changes in httpd.conf whenever you run scripts/rebuildhttpdconf. Other than that, an acceptable solution.

Thanks, Michael!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
To anyone else for whom this info might help, you will have to redo the changes in httpd.conf whenever you run scripts/rebuildhttpdconf. Other than that, an acceptable solution.
Is this the case even after using the Apache distiller?

Thank you.
 

edigest

Active Member
Nov 24, 2010
44
0
56
S. Pole
cPanel Access Level
Root Administrator
Is this the case even after using the Apache distiller?
Yes. After making the edit to /usr/local/apache/etc/httpd.conf I made another change to /var/cpanel/templates/apache2/vhost.local (which is where I add custom config that I want to apply to all websites) and then ran /scripts/rebuildhttpdconf to apply that change. The edit to httpd.conf for the special needs domain was lost.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Right, rebuilding the Apache configuration file does not distill the changes. You muse use the Apache distiller documented here:

Apache Config Distiller

Thank you.
 

edigest

Active Member
Nov 24, 2010
44
0
56
S. Pole
cPanel Access Level
Root Administrator
Right, rebuilding the Apache configuration file does not distill the changes. You muse use the Apache distiller documented here:

Apache Config Distiller
Ah, OK. It looks like you're saying I can use /usr/local/cpanel/bin/apache_conf_distiller --update instead of /scripts/rebuildhttpdconf when I make changes to /var/cpanel/templates/apache2/vhost.local.

That did not work for me before but I will give it a try again.

Thanks!