首页 > Web开发 > 详细

Apache隐藏版本号及其它敏感信息

时间:2014-10-31 12:12:35      阅读:290      评论:0      收藏:0      [点我收藏+]

bubuko.com,布布扣

默认显示

bubuko.com,布布扣

修改后显示


1. 隐藏Apache信息

1.1 主配置中启用httpd-default.conf
文件: conf/httpd.Conf
找到httpd-default.conf,删除前面的注释“#”,改成如下

Include conf/extra/httpd-default.conf

1.2 修改httpd-default.conf
文件:conf/extra/httpd-default.conf
找到

ServerTokens Full

改成

ServerTokens Prod

找到

ServerSignature On

改成

ServerSignature off

完成

最终如下(文件:conf/extra/httpd-default.conf)

#
# ServerTokens
# This directive configures what you return as the Server HTTP response
# Header. The default is ‘Full‘ which sends information about the OS-Type
# and compiled in modules.
# Set to one of:  Full | OS | Minor | Minimal | Major | Prod
# where Full conveys the most information, and Prod the least.
#
ServerTokens Prod
#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory 
# listings, mod_status and mod_info output etc., but not CGI generated 
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of:  On | Off | EMail
#
ServerSignature Off


说明:
1、ServerSignature出现在Apache所产生的像404页面、目录列表等页面的底部。
2、ServerTokens目录被用来判断Apache会在Server HTTP响应包的头部填充什么信息。
如果把ServerTokens设为Prod,那么HTTP响应包头就会被设置成:Server:Apache

Apache隐藏版本号及其它敏感信息

原文:http://my.oschina.net/u/205403/blog/339140

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!