Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic open_basedir with mod_vhost_alias

I'm using mod_vhost_alias and want to set dynamically open_basedir for each user. Something like

php_admin_value open_basedir /var/www/vhosts/%1

But it doesn't work. Because I have a lot of virtual hosts (4000-5000) mod_macro does not suit me.

I'm trying to apply this patch http://wiki.preshweb.co.uk/doku.php?id=apache:securemassvhosting

But with no success. Any suggestions?

like image 488
ALex_hha Avatar asked Dec 06 '25 05:12

ALex_hha


1 Answers

You can use auto_prepend option in php.ini to supply script that will be executed first. There you can setup open_basedir via ini_set() function based on contents of $_SERVER array.

like image 59
gmsalex Avatar answered Dec 09 '25 15:12

gmsalex



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!