APACHE PHP 头信息修改
| |
Posted in Unix/Linux/FreeBsd on 2008/12/14 / 引用(0)
为了安全要将Apache及 PHP 的版本隐藏防止XXX人无聊时xxx
,可以用以下方法:

Apache:

开启 httpd.conf,加入以下两行:

ServerTokens ProductOnly

ServerSignature Off

PHP: 隐藏 PHP 版本就是隐藏 "X-Powered-By: PHP/5.1.2-1+b1" 这个,开启 php.ini,加入: expose_php = Off 完成以上两个设定后,重新启动 Apache 即可。

另外,讲几个最基本的php的安全设置
禁用某些危险函数
disable_functions = system,exec,shell_exec,passthru,popen,dl,phpinfo
关闭错误
display_errors = Off

allow_url_fopen = Off
这个用了很多有XX
safe_mode = On

open_basedir = /usr/local/httpd/htdocs/dir1:/usr/local/httpd/htdocs/dir2



#目录权限控制,dir1中的php程序就无法访问dir2中的内容。反过来也不行
This entry comes from 本站原创 and has been read for 788 times.It is tagged with , , .
0 Responses
发表评论

昵称

网址

电邮

OpenID登入 高级选项 表情