安装openresty
执行命令:
mkdir -p /usr/server
cd /usr/server
yum install -y readline-devel openssl-devel gcc
wget http://openresty.org/download/ngx_openresty-1.7.7.2.tar.gz
tar -zxvf ngx_openresty-1.7.7.2.tar.gz
cd /usr/server/ngx_openresty-1.7.7.2
cd bundle/LuaJIT-2.1-20150120/
make clean && make && make install
ln -sf luajit-2.1.0-alpha /usr/local/bin/luajit
cd /usr/server/ngx_openresty-1.7.7.2/bundle
wget https://github.com/FRICKLE/ngx_cache_purge/archive/2.3.tar.gz
tar -zxvf 2.3.tar.gz
wget https://github.com/yaoweibin/nginx_upstream_check_module/archive/v0.3.0.tar.gz
tar -zxvf v0.3.0.tar.gz
cd /usr/server/ngx_openresty-1.7.7.2
yum-y install zlib zlib-devel openssl openssl--devel pcre pcre-devel
./configure --prefix=/usr/server/ --with-http_realip_module --with-luajit --add-module=./bundle/ngx_cache_purge-2.3/ --add-module=./bundle/nginx_upstream_check_module-0.3.0/ -j2
make && make install
查看nginx版本:
/usr/server/nginx/sbin/nginx -V
启动nginx:
/usr/server/nginx/sbin/nginx