openresty(Nginx) 隐藏 软包名称及版本号 升级版本

1 访问错误或者异常的URL

2 修改配置,重新编译,升级

#修改版本等
vim  ./bundle/nginx-1.13.6/src/core/nginx.h
#define nginx_version      1013006
#define NGINX_VERSION      "1.13.6"
#define NGINX_VER          "openresty/" NGINX_VERSION ".2"
改成
#define nginx_version      6099006
#define NGINX_VERSION      "6.99.6"
#define NGINX_VER          "webserver/" NGINX_VERSION ".2"
#修改ngx_http_special_response.c
vim  ./bundle/nginx-1.13.6/src/http/ngx_http_special_response.c

static u_char ngx_http_error_full_tail[] =
"<hr><center>" NGINX_VER "</center>" CRLF
"</body>" CRLF
"</html>" CRLF
;


static u_char ngx_http_error_build_tail[] =
"<hr><center>" NGINX_VER_BUILD "</center>" CRLF
"</body>" CRLF
"</html>" CRLF
;


static u_char ngx_http_error_tail[] =
"<hr><center>openresty</center>" CRLF
"</body>" CRLF
"</html>" CRLF
改成:
"<hr><center>webserver</center>" CRLF
"</body>" CRLF
"</html>" CRLF
;


static u_char ngx_http_error_build_tail[] =
"<hr><center>webserver</center>" CRLF
"</body>" CRLF
"</html>" CRLF
;


static u_char ngx_http_error_tail[] =
"<hr><center>webserver</center>" CRLF
"</body>" CRLF
"</html>" CRLF

#修改ngx_http_header_filter_module.c
vim ./bundle/nginx-1.13.6/src/http/ngx_http_header_filter_module.c
static u_char ngx_http_server_string[] = "Server: openresty" CRLF;
改成:
static u_char ngx_http_server_string[] = "Server: webserver" CRLF;

修改之前

#升级

#安装选项编译
./configure --prefix=/usr/local/openresty  --user=www --group=www  --with-http_gzip_static_module --with-threads --with-http_ssl_module --with-http_image_filter_module --with-debug --with-http_stub_status_module --with-openssl=../openssl-1.0.2j --with-http_v2_module --with-stream
#编译
make
#如果make 报如下错
/local/openresty/luajit/include/luajit-2.1 -I src/stream -I /opt/soft/openresty-1.25.3.1/build/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 \	-o objs/addon/src/ngx_http_echo_timer.o \
	../echo-nginx-module-0.63/src/ngx_http_echo_timer.c
../echo-nginx-module-0.63/src/ngx_http_echo_timer.c: In function 'ngx_http_echo_timer_elapsed_variable':
../echo-nginx-module-0.63/src/ngx_http_echo_timer.c:45:5: error: too many arguments to function 'ngx_time_update'
     ngx_time_update(0, 0);
     ^
In file included from src/core/ngx_core.h:77:0,
                 from ../echo-nginx-module-0.63/src/ddebug.h:5,
                 from ../echo-nginx-module-0.63/src/ngx_http_echo_timer.c:5:
src/core/ngx_times.h:24:6: note: declared here
 void ngx_time_update(void);
      ^
../echo-nginx-module-0.63/src/ngx_http_echo_timer.c: In function 'ngx_http_echo_exec_echo_reset_timer':
../echo-nginx-module-0.63/src/ngx_http_echo_timer.c:89:5: error: too many arguments to function 'ngx_time_update'
     ngx_time_update(0, 0);
     ^
In file included from src/core/ngx_core.h:77:0,
                 from ../echo-nginx-module-0.63/src/ddebug.h:5,
                 from ../echo-nginx-module-0.63/src/ngx_http_echo_timer.c:5:
src/core/ngx_times.h:24:6: note: declared here
 void ngx_time_update(void);
      ^
objs/Makefile:1988: recipe for target 'objs/addon/src/ngx_http_echo_timer.o' failed
make[2]: *** [objs/addon/src/ngx_http_echo_timer.o] Error 1
make[2]: Leaving directory '/opt/soft/openresty-1.25.3.1/build/nginx-1.25.3'
Makefile:10: recipe for target 'build' failed
make[1]: *** [build] Error 2
make[1]: Leaving directory '/opt/soft/openresty-1.25.3.1/build/nginx-1.25.3'
Makefile:4: recipe for target 'all' failed
#重新安装编译,增加--without-http_echo_module
./configure --prefix=/usr/local/openresty  --user=www --group=www  --with-http_gzip_static_module --with-threads --with-http_ssl_module --with-http_image_filter_module --with-debug --with-http_stub_status_module --with-openssl=../openssl-1.0.2j --with-http_v2_module --with-stream --without-http_echo_module
#备份旧版本,升级新的
mv  /usr/local/openresty/nginx/sbin/nginx /usr/local/openresty/nginx/sbin/nginx_bak0527
cp ./build/nginx-1.1.1/objs/nginx /usr/local/openresty/nginx/sbin/
#/usr/local/openresty/nginx/sbin/nginx

3 测试访问

相关推荐
疯狂飙车的蜗牛44 分钟前
从零玩转CanMV-K230(4)-小核Linux驱动开发参考
linux·运维·驱动开发
恩爸编程2 小时前
探索 Nginx:Web 世界的幕后英雄
运维·nginx·nginx反向代理·nginx是什么·nginx静态资源服务器·nginx服务器·nginx解决哪些问题
远游客07133 小时前
centos stream 8下载安装遇到的坑
linux·服务器·centos
马甲是掉不了一点的<.<3 小时前
本地电脑使用命令行上传文件至远程服务器
linux·scp·cmd·远程文件上传
jingyu飞鸟3 小时前
centos-stream9系统安装docker
linux·docker·centos
努力--坚持3 小时前
电商项目-网站首页高可用(一)
nginx·lua·openresty
超爱吃士力架3 小时前
邀请逻辑
java·linux·后端
cominglately6 小时前
centos单机部署seata
linux·运维·centos
魏 无羡6 小时前
linux CentOS系统上卸载docker
linux·kubernetes·centos
CircleMouse6 小时前
Centos7, 使用yum工具,出现 Could not resolve host: mirrorlist.centos.org
linux·运维·服务器·centos