以下仅作为个人实际实验结果记录,仅供参考。具体步骤没写,网上很多也很详细
-----------------------------------------------------------
Openresty 官网地址: http://openresty.org/en/download.html
下载需要的版本。
解压
wget https://openresty.org/download/openresty-1.13.6.1.tar.gz
tar -zxvf xxxx
下载:nginx_upstream_check_module
git地址: https://github.com/yaoweibin/nginx_upstream_check_module
unzip xxx
打补丁:(官方有写部分内容)
patch -p1 </path/to/nginx_http_upstream_check_module/check.patch
根据对应的nginx版本来选择对应的patch,但是我装的openresty-1.13.6.1似乎没有对应的包,用了12的,但是还是提示找不到,然后就直接回车了。(后面直接安装也没问题,萌新求解)
======
网友解答: https://www.oschina.net/question/2459866_2145514
======
编译安装:
./configure--prefix=/opt/openresty/releases/openresty-1.13.6.1--with-openssl=bundle/openssl-1.0.2h --with-pcre=bundle/pcre-8.41 --with-http_stub_status_module--http-client-body-temp-path=tmp/client_body_temp --http-proxy-temp-path=tmp/proxy_temp--http-fastcgi-temp-path=tmp/fastcgi_temp --http-uwsgi-temp-path=tmp/uwsgi_temp--http-scgi-temp-path=tmp/scgi_temp --add-module=./nginx_upstream_check_module
可以对比一下:下面是我安装好后的结果;
Nginx -V
nginxversion: openresty/1.13.6.1
builtby gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9)
builtwith OpenSSL 1.0.2h 3 May 2016
TLSSNI support enabled
configurearguments: --prefix=/opt/openresty/releases/openresty-1.13.6.1/nginx--with-cc-opt=-O2 --add-module=../ngx_devel_kit-0.3.0--add-module=../echo-nginx-module-0.61 --add-module=../xss-nginx-module-0.05--add-module=../ngx_coolkit-0.2rc3 --add-module=../set-misc-nginx-module-0.31--add-module=../form-input-nginx-module-0.12--add-module=../encrypted-session-nginx-module-0.07--add-module=../srcache-nginx-module-0.31 --add-module=../ngx_lua-0.10.11--add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.33--add-module=../array-var-nginx-module-0.05--add-module=../memc-nginx-module-0.18 --add-module=../redis2-nginx-module-0.14--add-module=../redis-nginx-module-0.3.7--add-module=../rds-json-nginx-module-0.15 --add-module=../rds-csv-nginx-module-0.08--add-module=../ngx_stream_lua-0.0.3--with-ld-opt=-Wl,-rpath,/opt/openresty/releases/openresty-1.13.6.1/luajit/lib--with-openssl=/root/openresty-1.13.6.1/bundle/openssl-1.0.2h--with-pcre=/root/openresty-1.13.6.1/bundle/pcre-8.41--with-http_stub_status_module--http-client-body-temp-path=tmp/client_body_temp--http-proxy-temp-path=tmp/proxy_temp --http-fastcgi-temp-path=tmp/fastcgi_temp--http-uwsgi-temp-path=tmp/uwsgi_temp --http-scgi-temp-path=tmp/scgi_temp--add-module=/root/openresty-1.13.6.1/nginx_upstream_check_module --with-stream--with-stream_ssl_module --with-http_ssl_module
一般nginx(或者是tengine)nginx -V给出的都是自定义安装的模块,默认安装的模块在可以通过./configure --help查看(--without的都是)
但是呢,openresty却不是!自定义和系统部分默认的都在这儿显示!!特别坑爹。导致萌新的我在新增模块的时候全部加上nginx -V的模块,./configure没错,在make就一直抱各种错误。后来才发现。
PS:./configure 后面跟的目录最后一个最好不加/,否则后面nginx -V会出现//的效果,虽然没有影响
附件:
nginx_upstream_check_module 使用方法:官网
联系客服