Everything2
Near Matches
Ignore Exact
Full Text
Everything2

How to get Apache to be a bit more secretive

created by zoeb

(idea) by zoeb (19.7 hr) (print)   ?   (I like it!) Fri Feb 11 2005 at 14:51:05

By default, Apache proudly tells everyone that it is your web server, along with such specifics as exactly which version you are using and even the versions of the individual modules. As friendly as this is, it's not particularly secure. So how do you get it to be a little less forthcoming with this information?

HTTP response headers

The HTTP headers are a good place to start. Every time someone asks your server for a file, they get these headers back first, including one identifying the server. This will say something like Apache/1.3.29 (Unix), or, even worse, Server: Apache/1.3.29 (Unix) mod_gzip/1.3.26.1a mod_perl/1.29. Thankfully, changing the server header to something a bit more subtle is pretty easy. Just slip the following line into your httpd.conf file:

ServerTokens Prod

This replaces the detailed information with a simple Server: Apache.

Error responses

The other place where Apache tends to divulge too much information is the footer of error responses, such as the dreaded 404 page. You can turn off the footer from .htaccess, so even if you don't have access to httpd.conf you can still turn it off for your own website. If you do have access to httpd.conf, it's probably a good idea to turn it off there, so that the change is global. Again, only one line needs to be added:

ServerSignature Off

Once you have added the two lines to httpd.conf, restart Apache (If you just added the one line to .htaccess, you don't need to restart anything; the change should take effect immediately). Apache should no longer divulge its exact version number at the drop of a hat, let alone a list of the modules you are using with it. Of course, this won't deter people who are serious about breaking into your site, but at least it'll keep the script kiddies at bay.


printable version
chaos

How to get Apache to send compressed versions of static HTML files How to get Apache to tell your visitors when files have moved or been deleted Apache .htaccess
Diebold's F1-XT microcontroller A Short Guide to Comparative Religions script kiddie dark-side hacker
How to improve your chances of having sex HTTP Cut and paste writeups will die U-Scan
website web server 404 One last kiss before the long goodbye
global
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Nodes to live by:
Josephine Baker in Berlin
Who is allowed to donate blood?
Spartacus
What my mother taught me
Quaternion
Panettone
Cathy Martin and the tunnel of fire
John McCain
Getting an apartment in New York City versus getting an apartment elsewhere
hops
The bride of Vankenstrein - conception
Corned beef
whirl mehitabel whirl
New Writeups
fallensparks
George's Marvellous Medicine(thing)
Ctrl Y
cognitive dissonance(fiction)
SharQ
Gone Baby Gone(review)
halfWit
If I could, I'd title this "Freedom"(thing)
Roninspoon
Airline Hero(thing)
Ktistec
Why Women Are Always Cold(person)
doctor wilson
Drug policy reform(thing)
tejasa
Easy Raspberry Cheesecake(recipe)
Joysim
Drug policy reform(idea)
aneurin
Tyburn(place)
niruena
Boiling to death(idea)
artman2003
summer(thing)
doctor wilson
The Silver City and the Silent Sea(log)
Dreamvirus
The Silver City and the Silent Sea(poetry)
Aerobe
A nihilist's soulmate(poetry)
E2 is a by-product of the existence of The Everything Development Company