完全隐藏服务器名称apache [英] Completely hide server name apache

查看:517
本文介绍了完全隐藏服务器名称apache的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的etc/apache2.conf文件中添加了这两行,并且隐藏了OS和apache版本.

I have added these 2 lines in my etc/apache2.conf file, and it hid the OS and apache version.

ServerSignature Off
ServerTokens Prod

但是毕竟我可以看到带有服务器名称的标题

But after all I can see the header with server name

Server  Apache

如何也隐藏此信息? 我正在使用Debian 7,apache v 2.2

How to hide this information as well ? I am using Debian 7, apache v 2.2

谢谢

推荐答案

Apache本身无法完全取消设置服务器标头(即使使用mod_headers也是如此).

Apache on its own cannot completely unset the Server header (not even with mod_headers).

如Apache所讨论的,此似乎是设计使然开发人员.

This appears to be by design, as discussed by the Apache devs.

有一种使用ModSecurity进行此操作的方法,但对此我知之甚少.相反,这些人已经知道了:

There is a way to do this using ModSecurity, but I know little about that. Instead, these people have it all figured out already:

https://unix.stackexchange.com/questions/124137/change -apache-httpd-server-http-header

我可以验证是否可行,只是在Debian 7.6上尝试过.

I can verify that this works, just tried on Debian 7.6.

修改: 为Apache安装Mod安全性,然后将其添加到您的apache2.conf中.

edit: install mod security for apache and then add this in your apache2.conf.

<IfModule security2_module>
    SecRuleEngine on
    ServerTokens Full
    SecServerSignature " "
</IfModule> 

重新启动apache之后,服务器标头将消失

After this restarting the apache, Server header will disappear

这篇关于完全隐藏服务器名称apache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆