|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们!webserver制止一些不用要的贫苦,能够把apache和php的版本信息不显现
埋没Apache版本信息
/etc/apache2/apache2.conf或/etc/httpd/conf/httpd.conf
ServerTokensProductOnly
ServerSignatureOff
重启apache
如今http头内里只看到:
Server:Apache
=====================
nginx
#vinginx.conf
在http加上server_tokensoff;
以下:
http{
……省略设置
sendfileon;
tcp_nopushon;
keepalive_timeout65;
tcp_nodelayon;
server_tokensoff;
…….省略设置
}
=======================
埋没PHP版本
php.ini
expose_phpOn
改成
expose_phpOff
重启apache后,php版本在http头中埋没了。
===
参考办理计划:
1.Lighttpd1.4.20
src/response.c:108改成:
buffer_append_string_len(b,CONST_STR_LEN("Server:jufukeji"));
输入Header:
HTTP/1.1404NotFound
Content-Type:text/html
Content-Length:345
Date:Mon,12Jan200913:54:02GMT
Server:jufukeji
2.Nginx0.7.30
src/http/ngx_http_header_filter_module.c:48-49改成:
staticcharngx_http_server_string[]="Server:jufukeji"CRLF;
staticcharngx_http_server_full_string[]="Server:jufukeji"CRLF;
输入Header:
HTTP/1.1200OK
Server:jufukeji
Date:Mon,12Jan200914:01:10GMT
Content-Type:text/html
Content-Length:151
Last-Modified:Mon,12Jan200914:00:56GMT
Connection:keep-alive
Accept-Ranges:bytes
3.Cherokee0.11.6
cherokee/version.c:93增加:
ret=cherokee_buffer_add_str(buf,"jufukeji");
returnret;
输入Header:
HTTP/1.1200OK
Connection:Keep-Alive
Keep-Alive:timeout=15
Date:Mon,12Jan200914:54:39GMT
Server:jufukeji
ETag:496b54af=703
Last-Modified:Mon,12Jan200914:33:19GMT
Content-Type:text/html
Content-Length:1795
4.Apache2.2.11
server/core.c:2784增加:
ap_add_version_component(pconf,"jufukeji");
return;
输入Header:
HTTP/1.1200OK
Date:Mon,12Jan200914:28:10GMT
Server:jufukeji
Last-Modified:Sat,20Nov200420:16:24GMT
ETag:"1920edd-2c-3e9564c23b600"
Accept-Ranges:bytes
Content-Length:44
Content-Type:text/html
5.Squid3.0STABLE11
src/globals.cc:58改成:
constchar*constfull_appname_string="jufukeji";
输入Header:
HTTP/1.0400BadRequest
Server:jufukeji
Mime-Version:1.0
Date:Mon,12Jan200915:25:15GMT
Content-Type:text/html
Content-Length:1553
Expires:Mon,12Jan200915:25:15GMT
X-Squid-Error:ERR_INVALID_URL0
X-Cache:MISSfromcache.hutuworm.org
Via:1.0cache.hutuworm.org(jufukeji)
Proxy-Connection:close
6.Tomcat6.0.18
java/org/apache/coyote/http11/Constants.java:56和java/org/apache/coyote/ajp/Constants.java:236均改成:
ByteChunk.convertToBytes("Server:jufukeji"+CRLF);
输入Header:
HTTP/1.1200OK
Server:jufukeji
ETag:W/"7857-1216684872000"
Last-Modified:Tue,22Jul200800:01:12GMT
Content-Type:text/html
Content-Length:7857
Date:Mon,12Jan200916:30:44GMT
7.JBoss5.0.0GA
a.tomcat/src/resources/web.xml:40改成
jufukeji
b.下载JBossWebServer2.1.1.GAsrctar(http://www.jboss.org/jbossweb/downloads/jboss-web/)
java/org/apache/coyote/http11/Constants.java:56和java/org/apache/coyote/ajp/Constants.java:236均改成:
ByteChunk.convertToBytes("Server:jufukeji"+CRLF);
将编译所得jbossweb.jar掩盖JBoss编译输入文件:
JBOSS_SRC/build/output/jboss-5.0.0.GA/server/all/deploy/jbossweb.sar/jbossweb.jar
JBOSS_SRC/build/output/jboss-5.0.0.GA/server/standard/deploy/jbossweb.sar/jbossweb.jar
JBOSS_SRC/build/output/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/jbossweb.jar
JBOSS_SRC/build/output/jboss-5.0.0.GA/server/web/deploy/jbossweb.sar/jbossweb.jar
输入Header:
HTTP/1.1200OK
Server:jufukeji
X-Powered-By:jufukeji
Accept-Ranges:bytes
ETag:W/"1581-1231842222000"
Last-Modified:Tue,13Jan200910:23:42GMT
Content-Type:text/html
Content-Length:1581
Date:Tue,13Jan200910:30:42GM
本文出自“王伟”博客,请务必保存此出处http://wangwei007.blog.51cto.com/68019/903420
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们! |
|