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 have been going crazy trying to remove response headers from my Apache2 server. I have mod_headers enabled and I have 'Header unset BLAH_HEADER_NAME' in my apache2.conf file, but it doesn't appear to be working, though 'Header append' appears to work..go figure.

I've read that mod_perl might work, but I don't have any experience doing this..any ideas. I also read that 'Header unset' might be bugged, is this confirmed.

share|improve this question
    
Which header are you trying to modify? –  Shane Madden Nov 8 '11 at 19:34
    
i'm trying to remove: Header unset Content-Length Header unset Keep-Alive Header unset Content-Type Header unset Server –  Robert Van Sant Nov 8 '11 at 19:39
    
i have ServerTokens Prod and ServerSignature Off, so in my Header unset Server, i'm just trying to remove the whole header in the response. i was given specs to have a minimalist response header to lighten the responses. –  Robert Van Sant Nov 8 '11 at 19:52

1 Answer 1

I can't really imagine why you'd want to unset all of those, breaking your compliance with the HTTP/1.1 standard.. but, Server cannot be unset (see here), while the others ought to work; try:

Header always unset Content-Length
Header onsuccess unset Content-Length
share|improve this answer
    
this actually didn't work this is what i have in my apache2.conf on ubuntu 11.10 <IfModule mod_headers.c> Header always unset Content-Length Header onsuccess unset Content-Length Header always unset Keep-Alive Header always unset Content-Type Header onsuccess unset Content-Type </IfModule> i definitely appreciate the help!! –  Robert Van Sant Nov 8 '11 at 20:10
    
this addition is at the bottom of my conf file after everything is loaded..fyi. –  Robert Van Sant Nov 8 '11 at 20:15

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.