Main Page

Friday, 12 February 2021

How to Hide Apache Version Number and OS information

 Step 1) Test the URL before hiding the information.

[root@master html]# curl -Ik http://localhost

HTTP/1.1 200 OK
Date: Fri, 12 Feb 2021 05:08:58 GMT
Server: Apache/2.4.37 (centos)
Last-Modified: Fri, 12 Feb 2021 05:08:47 GMT
ETag: "12-5bb1ca1878d2d"
Accept-Ranges: bytes
Content-Length: 18
Content-Type: text/html; charset=UTF-8

Step 2) Add or modify the below two lines

[root@master html]# egrep "ServerSignature|ServerTokens"  /etc/httpd/conf/httpd.conf
ServerTokens Prod
ServerSignature off


Step 3) Restart httpd service

[root@master html]# systemctl restart httpd

Step 4) Access the URL , Now you see the Apache version information and OS information is hidden.

[root@master html]# curl -Ik http://localhost
HTTP/1.1 200 OK
Date: Fri, 12 Feb 2021 05:13:40 GMT
Server: Apache
Last-Modified: Fri, 12 Feb 2021 05:08:47 GMT
ETag: "12-5bb1ca1878d2d"
Accept-Ranges: bytes
Content-Length: 18
Content-Type: text/html; charset=UTF-8



No comments:

Post a Comment