openresty安装及增加upstream_check_module
openresty安装及增加upstream_check_module
- 安装依赖包
1
yum install -y pcre-devel openssl-devel gcc curl make wget git patch
- 下载openresty安装包
1
2mkdir -p /root/source
wget https://openresty.org/download/openresty-1.21.4.1.tar.gz -O /root/source/openresty-1.21.4.1.tar.gz - 解压安装包
1
tar -zxvf /root/source/openresty-1.21.4.1.tar.gz
- 下载upstream_check_module
1
2cd /root/source/openresty-1.21.4.1/bundle
git clone https://mirror.ghproxy.com/https://github.com/xiaokai-wang/nginx_upstream_check_module.git - 编译安装upstream_check_module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18cd /root/source/openresty-1.21.4.1/bundle/nginx-1.21.4
patch -p1<../nginx_upstream_check_module/check_1.20.1+.patch
cd ..
./configure --prefix=/usr/local/openresty \
--user=www --group=www \
--with-http_stub_status_module \
--with-http_realip_module \
--with-http_gzip_static_module \
--with-http_v2_module \
--with-luajit \
--with-http_ssl_module \
--with-http_addition_module \
--with-http_v2_module \
--add-module=./bundle/nginx_upstream_check_module
make -j4
make install - 配置系统服务
1
vim /usr/lib/systemd/system/openresty.service
1
2
3
4
5
6
7
8
9
10
11
12
13[Unit]
Description=openresty
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/openresty/nginx/sbin/nginx
ExecReload=/usr/local/openresty/nginx/sbin/nginx -s reload
ExecStop=/usr/local/openresty/nginx/sbin/nginx -s quit
PrivateTmp=true
[Install]
WantedBy=multi-user.target1
2systemctl daemon-reload
systemctl start openresty
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Qiko!