为了隐藏 web 服务器版本号、服务器操作系统细节、已安装的 Apache 模块等等,使用编辑器打开 Apache 配置文件:
$ sudo vi /etc/apache2/apache2.conf #Debian/Ubuntu systems
$ sudo vi /etc/httpd/conf/httpd.conf #RHEL/CentOS systems
添加/修改/附加下面的行:
ServerTokens Prod
ServerSignature Off
保存并退出文件,重启你的 Apache 服务器:
$ sudo systemctl apache2 restart #SystemD
$ sudo sevice apache2 restart #SysVInit