Apache

How to Change Apache Server Name to Anything in Server Headers

The Apache web server is a very useful tool that can provide the web contents via internet. But it shows something important that may cause problems. The Apache web server tells everyone its name and version, and this can make our Apache server less secure.

Let us discuss about why it is important to change the Apache server’s name in the server headers and we will also talk about two different methods to perform it.

What Are Server Headers and Why We Must Change Its Name

Server headers are essential components of the data that web servers exchange with our browser when we visit a website. This data helps our browser and the server to communicate effectively. Changing the server’s name in these headers is a critical step to support our website’s security.

The Apache web server reveals its name by default such as “Apache/2.4.46”. While this might seem harmless in real-life situations, it can be a security risk for our website in the digital world.

This exposure allows the hackers to discern the software that our server relies on and, subsequently, identify the potential weaknesses to exploit. Changing the server’s name is equivalent to removing that conspicuous name tag and it makes it significantly more challenging for hackers to discover the vulnerabilities in our server. By doing so, we can secure our website’s defenses and increase its overall security.

Use “Centralops” to Change the Server Name in Server Headers

We can use “Centralops” to change the server’s name in server headers.

First, we need to start by visiting “centralops.net”. This online tool allows us to modify our server’s identity.

Then, we can find the option to enter the IP address/domain name of the Apache server.

After that, we need to search for the “Service Scan” option and make sure to check or enable it.

Once we entered the domain or IP and enabled the “Service Scan” option, we need to click on the “Go” button to begin the scan. This scan can obtain information about its FTP server and mail transfer protocols including SMTP, POP3, and IMAP.

With the information obtained, we can customize our web server’s name to appear as a different HTTP server such as Apache, Nginx, Lighttpd, and many more.

Use “Mod_Security” to Change the Server Name in Server Headers

We can use the “modsecurity” to modify the Apache server name in server headers. This does not only increase the security of our server but also opens up the advanced customization possibilities. The Apache server name can be changed to anything that we want.

First, we need to install the “mod_security” to change the server’s name in server headers.

$ sudo apt install libapache2-mod-security2

Then, we can activate it in our Linux system using the following command:

$ sudo a2enmod security2

After we installed and successfully activated the “mod_security” in our Linux operating system, we can proceed with the following steps:

Now, we have to open the Apache configuration file to edit the Apache server name to anything in the server headers.

$ sudo nano /etc/apache2/apache2.conf

After opening the Apache configuration file, we can now add the following lines in our configuration file:

ServerTokens Full

SecServerSignature "This_is_name"

After making these changes, we must restart our Apache web server to apply the modifications.

$ sudo systemctl restart apache2

We can use the “curl” command to ensure that the modification has taken effect. This reveals that the web server name has changed from “Apache” to the custom name that we mentioned which is “This_is_name”.

$ curl -I -L http://192.168.59.128

The previous command provides us with the server headers of the website or server associated with that IP address which is “192.168.59.128”.

Conclusion

We need to change the Apache server name in server headers since it is an important step to improve our website security. We can reduce the risk of vulnerabilities and improve the overall defenses by changing the name of Apache server. By understanding the tools like “Centralops” or “mod_security”, we can easily safeguard our Apache server.

Similar Posts