How to Hide Apache Version from HTTP Header

You can check the HTTP header of your server by using a simple curl command.
In HTTP header you will see on what version Apache is running.

$ curl -I  http://justgeek.in

You can see that your server is running with Apache 2.4.18 server.

 HTTP/1.1 200 OK
 Date: Mon, 2 December 2019 11:36:14 GMT
 Server: Apache/2.4.6 (CentOS)
 Last-Modified: Thu, 20 Oct 2016 05:30:08 GMT
 Accept-Ranges: bytes
 Content-Length: 11321
 Vary: Accept-Encoding
 Content-Type: text/html

To hide Apache Version, you will have to edit your Apache configuration file and add following variables.
Restart your apache after making change.

ServerTokens Prod
ServerSignature Off

Use the same http command again to check HTTP Header

$ curl -I  http://justgeek.in

Now you can see that header is only showing that Apache is running, but no version or OS details available there.

 HTTP/1.1 200 OK
 Date: Mon, 2 December 2019 11:36:14 GMT
 Server: Apache
 Last-Modified: Thu, 20 Oct 2016 05:30:08 GMT
 Accept-Ranges: bytes
 Content-Length: 11321
 Vary: Accept-Encoding
 Content-Type: text/html

Leave a Reply

Your email address will not be published. Required fields are marked *