访问网站 www.example.com
通过chrome的network或者 curl --head http://www.example.com
看到有以下头文件显示
HTTP/1.1 200 OK
Date: Fri, 20 Nov 2009 12:20:30 GMT
Server: Apache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6.4
X-Powered-By: PHP/5.2.3-1ubuntu6.4
Connection: close
Content-Type: text/html; charset=UTF-8
希望隐藏Server项的详细信息,可以修改apache的配置文件httpd.conf
在开放项中加入以下配置:
ServerSignature Off
ServerTokens Prod
在php.ini中加入配置:
expose_php = Off
重启服务,显示结果;
HTTP/1.1 200 OK
Date: Fri, 20 Nov 2009 13:06:21 GMT
Server: Apache
Connection: close
Content-Type: text/html; charset=UTF-8