How to remove server info at the bottom of the directory listing?

It looks like this: Apache/2.2.14 (Ubuntu) Server

  • As edited, the ServerSignature also appears on any apache error page, not just mod_autoindex pages. – EEAA Dec 3 '12 at 4:25
  • thank you for the thoughtful edits and clarification @EEAA – Bijou Trouvaille Dec 3 '12 at 4:54

Add ServerSignature Off line inside either the .htaccess, the virtual host file, or the main config file.

More info can be found in the official apache documentation.


Add ServerSignature Off to your main Apache config file.

Also search for ServerSignature On in your whole apache config folder:

cd /etc/apache2
grep -R 'ServerSignature On' * | grep -v '#'

and change all findings with ServerSignature Off

Also search in your web folder for such setting in all .htaccess files:

find /var/www/ -name ".htaccess" -print | xargs grep "ServerSignature On"|grep -v '#'

If those findings are too many, you can use sed to replace in the resulting output ServerSignature On with ServerSignature Off

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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