Hide Apache Software Version and Module Version
By default, Apache will show its version and moudules installed in HTTP Header and error messages pages. It's vulnerable and dangerous, we need to make changes in Apache main configuration file.
According to your Linux distribution, you can find Apache main configuration here:
/etc/httpd/conf/httpd.conf (RHEL/CentOS/Fedora)
/etc/apache/apache2.conf (Debian/Ubuntu)
Edit the Apache configuration file, find and change the following directives. Restart Apache and it's done.
ServerSignature Off
ServerTokens Prod
ServerSignature is used to set what to show when there is an error, for example, 404 eror (Page Not Found). There are three values for ServerSignature directive, Off, On and Email. The difference between On and Email is if you choose Email you will see a "mailto:" link to ServerAdmin.
The above image is not showing any Apache information, with ServerSignature set to value Off.

The above image is showing Apache and OS information, with ServerSignature set to value Email.
ServerTokens is used to set what to show in HTTP Header and error messages pages, there are six values: ProductOnly, Major, Minor, Minimal, OS and Full. Value Prod is recommended for everyone to set.
The above image is showing the information with ServerTokens set to vaule ProductOnly.
The above image is showing the information with ServerTokens set to vaule OS.
According to your Linux distribution, you can find Apache main configuration here:
/etc/httpd/conf/httpd.conf (RHEL/CentOS/Fedora)
/etc/apache/apache2.conf (Debian/Ubuntu)
Edit the Apache configuration file, find and change the following directives. Restart Apache and it's done.
ServerSignature Off
ServerTokens Prod
ServerSignature is used to set what to show when there is an error, for example, 404 eror (Page Not Found). There are three values for ServerSignature directive, Off, On and Email. The difference between On and Email is if you choose Email you will see a "mailto:" link to ServerAdmin.

The above image is not showing any Apache information, with ServerSignature set to value Off.

The above image is showing Apache and OS information, with ServerSignature set to value Email.
ServerTokens is used to set what to show in HTTP Header and error messages pages, there are six values: ProductOnly, Major, Minor, Minimal, OS and Full. Value Prod is recommended for everyone to set.

The above image is showing the information with ServerTokens set to vaule ProductOnly.

The above image is showing the information with ServerTokens set to vaule OS.
Comments
Post a Comment