PHP - a different open_basedir per each virtual host
Posted
by Lopoc
on Stack Overflow
See other posts from Stack Overflow
or by Lopoc
Published on 2010-05-06T12:48:47Z
Indexed on
2010/05/06
12:58 UTC
Read the original article
Hit count: 391
Hi I've came across on this problem, I have a sever running apache and php. We have many virtual hosts but we've noticed that a potentially malicious user could use his web space to browse other user's files(via a simple php script) and even system files, this could happens due to the php permissions. A way to avoid it is to set the open_basedir var in php.ini, yhis is very simple in a single host system, but in case of virtual hosts there would be a basebir per each host.
Ho can I set dis basedir per each user/host? is there a way to let apache hereditate php privileges of the php file that has been requested
E.G. /home/X_USER/index.php has as owner X_USER, when apache read the file index.php it checks its path and owner, simply I'm looking for a system set php basedir variable to that path.
Thank in advance Lopoc
© Stack Overflow or respective owner