Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to change the Apache server name to anything in the server header

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

In our previous articles, we explained some knowledge about the security and optimization of Apache servers, as well as how to hide the version number of Apache and other sensitive information.

We have discussed how to guard against valuable information, such as: Web server version number, server operating system details, Apache installed modules, and so on, the documents generated on the server are returned to the client (possibly *).

In this article, we will show you another useful Apache security advice-change the name of the HTTP web server when the header (header) message is displayed anywhere.

What exactly are we talking about here? Take a look at the screenshot below, which shows a list of document roots on our web server, and at the bottom of the page, you can also see the server's signature (web name, version, operating system, ip address and port).

Most of the time, * will use your known web software information to * your site or web application, so changing the name of the web service will become difficult for the type of service running on your system. This point is to change "Apache" to another name.

This can be achieved by installing the mod_security module of Apache.

-On Debian/Ubuntu-$sudo apt install libapache2-mod-security2 $sudo a2enmod security2- On CentOS/RHEL and Fedora-# yum install mod_security# dnf install mod_security

Then open the configuration file for Apache:

$sudo vi / etc/apache2/apache2.conf # Debian/Ubuntu # vi / etc/httpd/conf/httpd.conf # RHEL/CentOS/Fedora

Now modify or add the following command line to the bottom of the configuration file (now change to TecMint_Web, you can change to any name you want to display on the client)

ServerTokens FullSecServerSignature "Tecmint_Web"

Finally, restart the Apache service.

$sudo systemctl restart apache2 # Debian/Ubuntu # systemctl restart httpd # RHEL/CentOS/Fedora

Now verify that visiting the page again, either using the curl command or looking at the name of the web service through a browser, you can see that it has been changed from Apache to Tecmint_Web.

$curl-I-L http://domain-or-ipaddress

Original text link:

Https://www.tecmint.com/change-apache-server-name-to-anything-in-server-headers/

Tips:

If you add it directly to the zone configuration file without installing the mod_security module, you will report the following error:

[root@iZ288zd30s2Z ~] # service httpd restartStopping httpd: [OK] Starting httpd: Syntax error on line 1169 of / etc/httpd/conf/httpd.conf:Invalid command 'SecServerSignature', perhaps misspelled or defined by a module not included in the server configuration [FAILED]

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report