使用suphp,我为每个虚拟主机设置了一个php.ini。在php.ini中,我还设置了:
open_basedir = /home/site1php脚本运行,但是如果我有一个带有ls /我可以看到整个根目录的脚本。
怎么能关闭这个洞的安全?
<VirtualHost *:80>
ServerName site1
ServerAlias www.site1.com
DirectoryIndex index.html index.htm
DocumentRoot /home/site1/
suPHP_Engine on
AddHandler x-httpd-php .php .php3 .php4 .php5
suPHP_AddHandler x-httpd-php
# THIS READ php.ini
suPHP_ConfigPath /home/site1/
<Directory /home/site1/>
Options -Includes -Indexes -FollowSymLinks -ExecCGI -MultiViews
AllowOverride none
Order allow,deny
Allow from all
</Directory>
</VirtualHost>发布于 2013-06-30 19:30:00
可以禁用外部二进制文件的执行以消除此行为。
更新您可以这样做,您必须编辑您的php.ini
disable_functions=exec,passthru,shell_exec,
system,proc_open,popen,curl_exec,
curl_multi_exec,parse_ini_file,show_source (为了清晰起见,我包括了行间隔。)
这是原始网址:http://www.cyberciti.biz/faq/linux-unix-apache-lighttpd-phpini-disable-functions/
https://serverfault.com/questions/519747
复制相似问题