0

How to change Apache's Server: header without mod_security?

I do not want to use mod_security because I don't have anything else to do with it. And it is a useless overhead for me.

Instead, what should I change in the Apache's source? I usually use Apache compiled from source.

I am using Apache version 2.4.46.

Martijn Pieters
  • 963,270
  • 265
  • 3,804
  • 3,187
Example person
  • 2,832
  • 3
  • 12
  • 39

1 Answers1

0

To change Apache's Server: header, change the following in the source code:

Change the file /path/to/httpd-2.4.46/include/ap_release.h:

Go to the line like:

...
#define AP_SERVER_BASEPROJECT "Apache HTTP Server"
#define AP_SERVER_BASEPRODUCT "Apache"
...

And change it to anything, like:

...
#define AP_SERVER_BASEPROJECT "Apache Something My Server"
#define AP_SERVER_BASEPRODUCT "Apache My Server"
...

And then compile apache, and you are good!

Also, make sure to follow the license that is provided with it. Questions about license here are off-topic.

Example person
  • 2,832
  • 3
  • 12
  • 39