如何从响应头中完全删除apache信息 [英] How to remove apache information completely from response headers

查看:23
本文介绍了如何从响应头中完全删除apache信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Apache 配置中,服务器发送带有 Apache 信息的 HTTP Header.

In Apache configuration, the server sends HTTP Header with the Apache information.

google了一下,发现可以通过设置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.

  1. 添加 EPEL rpm:

  1. 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

    1. 擦除ifModule"内的所有指令,并在ifModule"内添加SecServerSignature"指令

    重启服务器

    这篇关于如何从响应头中完全删除apache信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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