Apache – Change the server identification header
Posted On 2021年7月29日
Apache – Change the server identification banner
Install the Apache server and the required packages.
apt-get update
apt-get install apache2 curl
Verify the Apache header.
curl -I http://127.0.0.1 --stderr - | grep -i server
Here is the command output.
Server: Apache/2.4.41 (Ubuntu)
Edit the Apache configuration file.
vi /etc/apache2/conf-available/security.conf
Here is the file, before our configuration.
ServerTokens OS
ServerSignature On
TraceEnable Off
Here is the file, after our configuration.
ServerTokens Prod
ServerSignature Off
TraceEnable Off
Restart the Apache service.
service apache2 restart
The Apache header will only display the basic information.
Server: Apache
Apache – Configure a custom server header
Install the Apache server and the required packages.
apt-get update
apt-get install apache2 libapache2-mod-security2 curl
Verify the Apache header.
curl -I http://127.0.0.1 --stderr - | grep -i server
Here is the command output.
Server: Apache/2.4.41 (Ubuntu)
Edit the Apache configuration file.
vi /etc/apache2/conf-available/security.conf
Here is the file, before our configuration.
ServerTokens OS
ServerSignature On
TraceEnable Off
Here is the file, after our configuration.
ServerTokens OS
ServerSignature On
SecServerSignature Microsoft-IIS/8.0
TraceEnable Off
Restart the Apache service.
service apache2 restart
Verify the Apache header.
curl -I http://127.0.0.1 --stderr - | grep -i server
Here is the command output.
Server: Microsoft-IIS/8.0