有时候可能会对服务器隐藏些信息而不让有图谋不轨的家伙知道,可以简单的设置下。
1. 修改Apache配置,例如:/usr/local/apache2/conf/httpd.conf
1.1 对php文件后缀的隐藏,添加:
AddType application/x-httpd-php .pl .py .asp .jsp .aspx .htm .html
AddType application/x-httpd-php .make .do .ok
1.2 隐藏HTTP返信息, 添加:
ServerTokens Prod
ServerSignature Off
2. 修改PHP配置,例如:/usr/local/lib/php.ini
将
session.name = PHPSESSID
修改为
session.name = MYSESSID
将
修改为
3. 重启Apache
HTTP/1.1 200 OK
Date: Fri, 02 Apr 2010 04:51:40 GMT
Server: Apache
Set-Cookie: MYSESSID=da42854b6f1c5b0320c5e1a0ce04a295; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 87
Connection: close
Content-Type: text/html; charset=gb2312
|
阅读(1473) | 评论(0) | 转发(0) |