首页  ·  知识 ·  基础设施
隐藏服务器版本和相关基本安全设置
佚名  本站原创  数据中心  编辑:dezai  图片来源:网络
为了安全要将Apache及 PHP 的版本隐藏,可以用以下方法: Apache: 开启 httpd.conf,加入以下两行: ServerTokens ProductOnly

为了安全要将Apache及 PHP 的版本隐藏,可以用以下方法:

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

safe_mode = On

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

#目录权限控制,dir1中的php程序就无法访问dir2中的内容。反过来也不行


lighttpd:


server.tag

set the string returned by the Server: response header

Default: lighttpd

Example: server.tag = "Apache/1.3.29 (Unix) mod_perl/1.29 PHP/4.4.1 mod_ssl/2.8.16 OpenSSL/0.9.7g"


前段参考:
http://www.php-oa.com/2008/01/07/php-apache/
后段参考:
http://trac.lighttpd.net/trac/wiki/server.use-tagDetails

本文作者:佚名 来源:本站原创
CIO之家 www.ciozj.com 微信公众号:imciow
    >>频道首页  >>网站首页   纠错  >>投诉
版权声明:CIO之家尊重行业规范,每篇文章都注明有明确的作者和来源;CIO之家的原创文章,请转载时务必注明文章作者和来源;
延伸阅读
也许感兴趣的
我们推荐的
主题最新
看看其它的