HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   How To Set Up Apache2 With mod_fcgid And PHP5 On CentOS (http://www.howtoforge.com/forums/showthread.php?t=57758)

gabbo85 28th June 2012 01:21

How To Set Up Apache2 With mod_fcgid And PHP5 On CentOS
 
I have read and followed this howto, but I'm pretty confused.
I added the following php script in / var/www/web1/web/test.php and calling it from the browser I can read the contents of the entire server, including the document root of web2.
PHP Code:

<?php
$dir    
'/etc/httpd';
$files1 scandir($dir);

print_r($files1);
?>

Output: Array ( [0] => . [1] => .. [2] => conf [3] => conf.d [4] => logs [5] => modules [6] => run )
How can I limit web1 only to its document root / var/www/web1/web/ ?
Thanks

falko 28th June 2012 15:59

You can set open_basedir to /var/www/web1/web, e.g. with the line

Code:

exec /usr/bin/php-cgi -d open_basedir=/var/www/web1/web
in your php-fcgi-starter script.


All times are GMT +2. The time now is 17:26.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.