隐藏Apache版本号的信息

1. 在默认情况下,系统会把Apache版本模块都显示出来(http返回头信息)。如果列举目录的话,会显示域名信息(文件列表正文),如:

[root@localhost tmp]# curl -I 192.168.0.1:80
HTTP/1.1 200 OK
Date: Tue, 05 Apr 2022 07:21:17 GMT
Server: Apache/2.4.12 (Unix)
Last-Modified: Tue, 27 Oct 2015 14:54:32 GMT
ETag: "2d-5231741665a00"
Accept-Ranges: bytes
Content-Length: 45
Content-Type: text/html

**2. 隐藏Apache版本号的方法是修改Apache的配置文件

ServerTokens ProductOnly
ServerSignature Off

3. 重启或重新加载Apache, 测试一下,如下:

[root@localhost tmp]# curl -I 192.168.0.1:80
HTTP/1.1 200 OK
Date: Tue, 05 Apr 2022 07:27:05 GMT
Server: Apache
Last-Modified: Tue, 27 Oct 2015 14:54:32 GMT
ETag: "2d-5231741665a00"
Accept-Ranges: bytes
Content-Length: 45
Content-Type: text/html

“`

你可能感兴趣的:(应用)