禁止显示或发送Apache版本号

在服务器上用wamp搭建完环境后,输入某些不存在的地址时,会出现Forbidden信息:

You don't have permission to access / onthis server.

Apache/2.4.23 (Win64) PHP/5.6.25 Server at123.207.226.239 Port 80

  

默认地,服务器HTTP响应头也会包含apache和php版本号。这很危险,因为黑客可能通过知道详细的版本号而发起已知该版本的漏洞攻击。所以我们可在http.conf中修改成:

ServerTokens Prod
ServerSignature Off

  

备注:可能会因为apache版不同,在其他地方修改。

原文地址:https://www.cnblogs.com/meetuj/p/12194810.html