I have a subdomain with many projects. Also, for some reason (don't ask me why) I have separate Location
directives for each subfolder under that subdomain. This project folders are created dynamically through a bash script, along with an Apache
VirtualHost
file.
So let's say I create another project, it would be at subdomain.mydomain.com/myproject
.
Besides the myproject
folder being created, as I said, the script also create a VirtualHost
with a Location
directive for that folder.
The problem is all this VirtualHost
s have the same ServerName
: subdomain.mydomain.com
and therefore cancel themselves, only one of them remaining active.
The solution is somewhat simple: instead of creating a VirtualHost
for every project folder, create Location
s, under the same VirtualHost
file. This would be OK if I did this manually, but since it is an automated bash script that does this it's much easier to create/remove an extra file than to append/remove text within an existant file.
So the question is, taking my scenario in mind, is there a way to add Location
s to the same ServerName
through separate Apache files, as opposed to having them all in one big file?
Thanks!