Forum Moderators: phranque
I'm not sure how to describe my question, so sorry for the vague title. But say I have something like this in my http.conf:
<Directory /home/FOO/public_html>
PerlAccessHandler Apache::myAuth
PerlSetVar user_list "/etc/httpd/conf/secure-docs/FOO"
...
</Directory>
Don't worry too much about the functionality and what the above is trying to do, it's more as an illustrative example. My question is, notice above I have the home directory of user "FOO" as part of a <directory> directive. Now on the second line of the the body of that directive, I have a FOO as well. These two things must match up.
Basically, this <DIRECTORY> directive is used in this case for a proprietary authentication perl module for my organization that protects certain directories/files the way it's set up. Now this is just an example to protect user FOO's files. I have a system that will have many users, and I hope there is a better way to add all the protection mechanisms to all the users than to add DIRECTORY entries like this for each and every user.
Does Apache somehow have some sort of concept of "variables" where I can indicate which two things have to be the same in the entries? For example:
<Directory /home/$VARIABLE/public_html>
PerlAccessHandler Apache::myAuth
PerlSetVar user_list "/conf/secure-docs/$VARIABLE"
...
</Directory>
so that when the directory /home/$VARIABLE/public_html is visited by on the web through something like [[webserver]...] depending on the what $VARIABLE is, e.g. the user FOO, then FOO will be replaced on the second line in the body. This way, one DIRECTORY entry like this is only necessary, rather than a separate one for each and every user. I hope Apache can be hacked into doing something like this. Or if anyone has any other advice, I'd like to hear it. It's just that because of the requirement for me to use this type of authentication mechanism, I do have to stick w/ protecting directories by calling a this type of proprietary authentication perl module.
Thank you all for you time and input.
-Ray C.
One of these my be of use to you:
http://httpd.apache.org/docs/2.0/mod/mod_alias.html#AliasMatch [httpd.apache.org]
http://httpd.apache.org/docs/2.0/mod/mod_userdir.html [httpd.apache.org]
Andrew