6

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

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

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

2 Answers 2

8

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.

3

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .