部署openresty
新建目录
mkdir -p /usr/servers
cd /usr/servers/
安装必要的程序
yum install -y readline-devel pcre-devel openssl-devel gcc
下载openresty
wget https://openresty.org/download/openresty-1.11.2.4.tar.gz
tar -zxvf openresty-1.11.2.4.tar.gz
安装LuaJIT
cd /usr/servers/openresty-1.11.2.4/bundle/LuaJIT-2.1-20170405
make clean && make && make install
创建链接
ln -sf luajit-2.1.0-alpha /usr/local/bin/luajit
下载ngx_cache_purge模块,该模块用于清理nginx缓存
cd bundle
wget https://github.com/FRiCKLE/ngx_cache_purge/archive/2.3.tar.gz
tar -xvf 2.3.tar.gz
下载nginx_upstream_check_module模块,该模块用于ustream健康检查
cd bundle
wget https://github.com/yaoweibin/nginx_upstream_check_module/archive/v0.3.0.tar.gz
tar -xvf v0.3.0.tar.gz
安装openresty
cd /usr/servers/openresty-1.11.2.4
./configure --prefix=/usr/servers --with-http_realip_module --with-pcre --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/servers/nginx/sbin/nginx
-V 查看版本