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

110807_bzpm_205403.png

默认显示

111107_sO8K_205403.png

修改后显示


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

转载于:https://my.oschina.net/u/205403/blog/339140

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值