Custom Vhost Question
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.
-
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. 0 -
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! 0 -
[quote="edigest, post: 1577801">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.0 -
[quote="cPanelMichael, post: 1578202">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.0 -
Right, rebuilding the Apache configuration file does not distill the changes. You muse use the Apache distiller documented here: [url=https://display/EA/Custom+Directives+Outside+of+a+VirtualHost+Tag#CustomDirectivesOutsideofaVirtualHostTag-Apacheconfigdistiller]Apache Config Distiller Thank you. 0 -
[quote="cPanelMichael, post: 1578291">Right, rebuilding the Apache configuration file does not distill the changes. You muse use the Apache distiller documented here: [url=https://display/EA/Custom+Directives+Outside+of+a+VirtualHost+Tag#CustomDirectivesOutsideofaVirtualHostTag-Apacheconfigdistiller]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!0
Please sign in to leave a comment.
Comments
6 comments