自动安装带nginx_upstream_check_module模块的Nginx脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash   
useradd  -s  /sbin/nologin  -M nginx    
yum  install  pcre pcre-devel zlib zlib-devel openssl-devel openssl patch gcc -y
 
mkdir  /software ; cd  /software   
wget http: //nginx .org /download/nginx-1 .4.6. tar .gz    
wget http: //labs .frickle.com /files/ngx_cache_purge-2 .1. tar .gz    
wget http: //geolite .maxmind.com /download/geoip/api/c/GeoIP-1 .4.8. tar .gz    
wget https: //codeload .github.com /yaoweibin/nginx_upstream_check_module/zip/master  -O master.zip  
wget https: //github .com /zls0424/ngx_req_status/archive/master .zip -O ngx_req_status.zip
 
tar  zxvf GeoIP-1.4.8. tar .gz &&  cd  GeoIP* && . /configure  &&  make  &&  make  install
cd  /software/  &&  tar  zxvf nginx-1.4.6. tar .gz &&  tar  zxvf ngx_cache_purge-2.1. tar .gz -C  /usr/local/   
unzip -d  /usr/local/  /software/master .zip    
unzip -d  /usr/local/  /software/ngx_req_status .zip    
cd  /software/nginx-1 .4.6 && patch -p1 <  /usr/local/nginx_upstream_check_module-master/check_1 .2.6+.patch    
patch -p1 <  /usr/local/ngx_req_status-master/write_filter .patch
 
cat  /etc/ld .so.conf << EOF   
include ld.so.conf.d/*.conf    
/usr/local/lib    
EOF
 
ldconfig
cd  /software/nginx-1 .4.6 && . /configure  --sbin-path= /usr/sbin/nginx  --conf-path= /etc/nginx/nginx .conf --pid-path= /var/run/nginx/nginx .pid --error-log-path= /var/log/nginx/error .log --http-log-path= /var/log/nginx/access .log --user=nginx --group=nginx --with-pcre --with-http_gzip_static_module --with-http_ssl_module --with-http_realip_module --with-http_geoip_module --add-module= /usr/local/nginx_upstream_check_module-master  --add-module= /usr/local/ngx_cache_purge-2 .1 --add-module= /usr/local/ngx_req_status-master  &&  make  -j2 &&  make  install


关于nginx_upstream_check的官方参考:https://github.com/yaoweibin/nginx_upstream_check_module/blob/master/README





本文转自 bannerpei 51CTO博客,原文链接:http://blog.51cto.com/281816327/1606723,如需转载请自行联系原作者
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值