产考博文
- 官方安装方法 http://openresty.org/en/installation.html
- 开涛跟我学Nginx+Lua http://www.jb51.cc/article/p-tqymjidn-boe.html
安装顺序
1,创建安装目录
mkdir -p /usr/servers cd /usr/servers/
2,安装依赖
yum install libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl readline-devel pcre-devel openssl-devel gcc
3,下载最新版的ngx_openresty
wget https://openresty.org/download/openresty-1.11.2.3.tar.gz tar -xzvf openresty-1.11.2.3.tar.gz
4,安装LuaJIT
cd openresty-1.11.2.3/bundle/LuaJIT-2.1-20170405 make clean && make && make install ln -sf LuaJIT-2.1-20170405 /usr/local/bin/luajit
5 下载ngx_cache_purge模块
该模块用于清理Nginx缓存
cd /usr/servers/openresty-1.11.2.3/bundle wget https://github.com/FRiCKLE/ngx_cache_purge/archive/2.3.tar.gz tar -xvf 2.3.tar.gz
6 下载Nginx_upstream_check_module模块
该模块用于ustream健康检查
cd /usr/servers/openresty-1.11.2.3/bundle wget https://github.com/yaoweibin/Nginx_upstream_check_module/archive/v0.3.0.tar.gz tar -xvf v0.3.0.tar.gz
7 安装 OpenResty
cd /usr/servers/openresty-1.11.2.3 ./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
其他
- 核心和第三方模块目录 openresty-1.11.2.3/bundle