1.隐藏nginx的版本号和server信息
[root@node2 nginx-1.8.0]# vim src/http/ngx_http_special_response.c
static u_char ngx_http_error_tail[] =
"<hr><center>tingyun</center>" CRLF --修改定义的名字
"</body>" CRLF
"</html>" CRLF
[root@node2 nginx-1.8.0]# vim src/http/ngx_http_header_filter_module.c
static char ngx_http_server_string[] = "Server: tingyun" CRLF;
[root@node2 nginx-1.8.0]# vim src/core/nginx.h
#define NGINX_VERSION ""
#define NGINX_VER "tingyun/" NGINX_VERSION
#define NGINX_VAR "tingyun"
[root@node2 nginx-1.8.0]# ./configure --prefix=/usr/local/nginx-1.8.0 --user=www --group=www --with-poll_module --with-threads --with-file-aio --with-http_sub_module --with-pcre=/usr/local/pcre-8.37 --with-http_stub_status_module --编译
[root@node2 nginx-1.8.0]# make && make install
2.隐藏apache的版本号
本文出自 “一起走过的日子” 博客,请务必保留此出处http://tongcheng.blog.51cto.com/6214144/1714681
原文地址:http://tongcheng.blog.51cto.com/6214144/1714681