如何从响应头中完全删除Apache信息 [英] How to remove apache information completely from response headers
问题描述
在Apache配置中,服务器发送带有Apache信息的HTTP标头.
In Apache configuration, the server sends HTTP Header with the Apache information.
在谷歌搜索之后,我发现可以通过设置ServerTokens和ServerSignature指令来控制此信息.
After googling, I found that this information can be controlled by setting ServerTokens and ServerSignature directives.
"ServerTokens prod"在响应标头中仅显示"Apache".
"ServerTokens prod" will show only 'Apache' in the response header.
有没有一种方法可以从标头中隐藏"Apache"一词?
Is there a way to hide even 'Apache' word from the header?
推荐答案
我将给出示例,说明如何在centos7 OS上解决该问题.
I'll give the example how to solve that on centos7 OS.
-
添加EPEL转速:
Add the EPEL rpm:
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
安装mod_security:
Install the mod_security:
yum install mod_security mod_security_crs
3.转到mod_security.conf文件并对其进行编辑
3.Go to mod_security.conf file and edit that
-
擦除"ifModule"中的所有指令,并在"ifModule"中添加 SecServerSignature" 指令
重新启动服务器
这篇关于如何从响应头中完全删除Apache信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!