您的位置:首页 > 运维架构 > Apache

禁掉Apache web server签名 How to turn off server signature on Apache web server

2015-07-01 16:07 711 查看
有的时候,我们为了从安全角度考虑,防止黑客恶意攻击,我们会隐藏掉server信息,比如,一般我们会发现如下信息。



我用的是centos (fedora, RHEL也一样)

$ sudo vi /etc/httpd/conf/httpd.conf


其他的系统(ubuntu, Debian)

$ sudo vi /etc/apache2/apache2.conf


我们可以在这个文件中添加两行信息

ServerSignature Off //隐藏Apache版本信息
ServerTokens Prod//第一条命令虽然不会在页面上直接显示,但在response的头部还会包含,所以加上此条。


然后再重启网络

$ sudo service apache2 restart (Debian, Ubuntu or Linux Mint)
$ sudo service httpd restart (CentOS/RHEL 6)
$ sudo systemctl restart httpd.service (Fedora, CentOS/RHEL 7, Arch Linux)


即可解决该问题。

具体参见:

http://ask.xmodulo.com/turn-off-server-signature-apache-web-server.html

shell脚本参见:

http://write.blog.csdn.net/mdeditor#!postId=47006651
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: