Order of VirtualHost entries in httpd.conf ?
Is there a way to control the order of VirtualHost entries in httpd.conf?
Background:
I've setup a virtualhost with a wildcard ServerAlias (*.mydomain.com).
Additionally there is a virtualhost (cPanel SubDomain) called blog.mydomain.com.
This worked fine until the httpd.conf file was apparently newly generated and the order of the virtual domains magically changed, causing blog.mydomain.com to redirect to the wildcard virtualhost.
-
Thank you for the link. So is the solution that when I manually change the order in httpd.conf (which I did as temporary workaround), the following script would somehow magically preserve the order of the VirtualHost entries? /usr/local/cpanel/bin/apache_conf_distiller --update 0 -
Hello, Right, the Apache distiller is used to preserve changes to the Apache configuration file. Thank you. 0 -
Unfortunately this didn't work. I've tried: - changing the order of the VirtualHost entries and run apache_conf_distiller --update - manually adding a VirtualHost entry and run apache_conf_distiller --update Both changes where lost the next time the configuration was automatically created As alternative, what determines in WHM in what order the VirtualHost entries are generated? Is it possible to use some prefix or change the order in a database to get this permanently resolved? 0 -
Thanks. That's what I ended up doing. Bit of a hack but it seems to work.. Still wonder if there is a cleaner way of setting the VirtualHost order? -1 -
Still wonder if there is a cleaner way of setting the VirtualHost order?
There's no easier methods I'm aware of, but it's a good idea for a feature request: Submit A Feature Request Thank you.0
Please sign in to leave a comment.
Comments
8 comments