I have an Apache 2 web server that allows access to the public_html
directory for each user via mod_userdir
, like this:
<IfModule mod_userdir.c>
UserDir public_html
UserDir disabled root
<Directory /home/*/public_html>
# [*] configuration here
</Directory>
</IfModule>
I would like to additionally configure PHP's open_basedir
directive to forbid file access outside the user's homedir. For user jim
, the directive would be
php_admin_value open_basedir "/home/jim/"
Question: Does Apache offer a way to do this through a variable at the spot marked [*]
above, something like the following?
<Directory /home/*/public_html>
php_admin_value open_basedir "${APACHE_CURRENT_DIRECTORY}"
</Directory>