I need to have my Apache web-server serve a lot of sites through
<Location /> structures. The last thing I want is a massive file with every single
<Location /> structure for every single site in there (not even a generated one). I've been looking into
mod_rewrite and some of the mass virtual hosting modules available for Apache but, unfortunately, I did not find what I was looking for.
The other day I was looking into
mod_perl and as I understand it, I can use
mod_perl to 'script' the Apache web server. This made me wonder if this is the solution I've been looking for? I've been searching around for specific examples to my problem but I can't seem to find anything specific.
My question is, to what extend can I have
mod_perl generate my
<Location /> structures at request time and what sort of variables do I have access to while doing this?
Just for clarity I'd like to give an example of the sort of thing that I'm trying to do. I know that the following example is not correct but I'm looking for a way to do something like this (at request time):
<Location /$1/$2> AuthType Basic AuthName "Secure area" AuthUserFile /sites/$1/$2/users.file </location>
So what I want is; Imagine that
$1 is the name of a department and that
$2 is the name of a project. If I would go the the url
mydomain.com/financial/accounts that the
users.file from the directory
/sites/financial/accounts is used. Every location has a different
users.file and if a url doesn't translate to a file system path, a normal 404 is shown or it just won't work. This way I can create a single
<location /> pattern without having to maintain a large amount of
<location />s and to necessity to reload the server every time I make a change.