Currently if you need custom configuration in a vhost you have to write some simple code. But I was thinking we could simplify this even further by handling it similar to how Aegir handles local.settings.php it includes it from settings.php if it exists.
So inside each vhost config file we'd have an include. However we can't use the same syntax as we use with local.settings.php because local.example.com could be a domain name so I was thinking one solution would be local_example.com or another solution would be create a new directory at ~/config/server_name/apache/custom.vhost.d and it could contain the custom vhost configs using the same name used in the vhost.d directory.
I don't have a lot of knowledge about Aegir so I'm interested to hear if I'm heading in the right direction with this idea?
Comments
Comment #1
SeanBannister commentedJust realised, one reason we can't place local_example.com in ~/config/server_name/apache/vhost.d/ is every file in the directory gets included from apache.conf so we'd have to use something like ~/config/server_name/apache/custom.vhost.d/example.com
Comment #2
anarcat commentedThere are the post.d and pre.d directories where you can put overrides for vhosts and such, is that what you are looking for?
Or are you looking for a config file included *within* the
<VirtualHost>directive?One problem with explicitely including a apache config file is that apache will fail to start if the file is not present... So we can't actually do the same thing as the local.settings.php, as we can't check if the file exists....
Comment #3
ergonlogicClosing for lack of activity, and since it appears that we can already accomplish the desired result. Feel free to re-open if anyone has a suggestion as to how to pursue this. This might also be of interest: #2020087: Use the <Location>-based approach from subdirs for all site vhosts