Narendra Bhati
Narendra Bhati

Reputation: 11

Modify Apache Server Header Name

I am using Ubuntu and i want to modify the header from "Server: Apache/2.2.22 (Ubuntu)" to "Server: MyName" How can i do this ? without using ModSecurity !

If possible please mention clear steps.

Upvotes: 1

Views: 941

Answers (1)

Barry Pollard
Barry Pollard

Reputation: 46040

You can't without editing the source code, or installing something like ModSecurity, or putting something else in front of Apache.

Best you can do is change it to "Server: Apache" by adding the following to your Apache config:

ServerTokens Prod

See ServerTokens documentation for more details.

It's been asked time and time again to allow this to be done in Apache in the change would be quite simple to do, but the Apache developers strongly disagree with this and say it adds no security value ("The idea of "security through obscurity" is a myth and leads to a false sense of safety.").

While the benefits of hiding this may well be overstated, many (myself included) disagree with Apache's stance here, and certainly disagree with the default setting for ServerTokens ("Full"). Some might argue its ego forcing you to keep "Apache" there.

Anyway, at same time ,I don't feel strongly enough about it to manually editing the source code, each time I upgrade, or to install anything else to work round their instance in (each of which could cause more issues), so live with just "Apache". Not that big a deal.

Upvotes: 2

Related Questions