NGINX编译安装

准备编译软件包

tar -zxvf nginx-1.18.0.tar.gz
cd nginx-1.18.0

伪装nginx变tomcat

#修改nginx源码配置文件
nginx-xxx/src/core/nginx.h
nginx-xxx/src/http/ngx_http_header_filter_module.c
nginx-xxx/src/http/ngx_http_special_response.c

[root@oldboyedu nginx-1.16.1]# sed -n '13,14p;22p' src/core/nginx.h
#define NGINX_VERSION      "8.5.50"
#define NGINX_VER          "Tomcat/" NGINX_VERSION
#define NGINX_VAR          "Tomcat"

[root@oldboyedu nginx-1.16.1]# grep -n Tomcat  src/http/ngx_http_header_filter_module.c
49:static u_char ngx_http_server_string[] = "Server: Tomcat" CRLF;

[root@oldboyedu nginx-1.16.1]# grep -n  Tomcat  src/http/ngx_http_special_response.c 
36:"<hr><center>Tomcat</center>" CRLF

安装依赖软件

yum install -y   openssl-devel  pcre-devel


版权声明:本文为weixin_43046446原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。