Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I run a CentOS box with WHM/cPanel, and I rebuilt Apache to have mod_headers.

mod_headers works fine when I am adding new headers, but for some reason I cannot change the "Server:" header to a different value.

I have tried

Header unset Server
Header set Server "Test"

but it still does not change it in the request. Meanwhile, other header directives such as

Header add foo bar

shows up in the HTTP response.

How can I use mod_headers to change the value of the HTTP "Server:" response? Thanks in advance.

share|improve this question

2 Answers 2

Apache version? In 1.3 and earlier mod_headers can't alter Server header, but you may alter defines in sources and recompile it.

share|improve this answer
    
I am running Apache/2.2.1 –  David Oct 4 '11 at 9:51
    
In what context are you using Header directive? Try to leave only unset directive, will the Server: header disappear? If not, this is bug,report it to CentOS maintainers –  Selivanov Pavel Oct 4 '11 at 14:58

Actually the Server: header is controlled by the ServerTokens directive in apache and you can set it to Prod to send minimal info out.

ref: http://httpd.apache.org/docs/2.2/mod/core.html#servertokens

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.