nginx lua整合安裝2
安裝lua JIT
下載
wget http://luajit.org/download/LuaJIT-2.0.4.tar.gz
解壓:
tar zxvf LuaJIT-2.0.4.tar.gz
進入目錄:
cd LuaJIT-2.0.4
編譯並安裝
make install PREFIX=/usr/local/luajit
配置
vi /etc/profile
export LUAJIT_LIB=/usr/local/luajit/lib
export LUAJIT_INC=/usr/local/luajit/include/luajit-2.0
source /etc/profile
鏈接
echo "/usr/local/luajit/lib" > /etc/ld.so.conf.d/usr_local_luajit_lib.conf
ldconfig
獲取l
ua-nginx-module
下載
wget https://github.com/openresty/lua-nginx-module/archive/v0.9.19.tar.gz
解壓
tar xzvf v0.9.19.tar.gz
獲取NDK
下載
wget https://github.com/simpl/ngx_devel_kit/archive/v0.2.19.tar.gz
解壓
tar xzvf v0.2.19.tar.gz
安裝ngnix
卸載nginx
cd /usr/local/nginx
rm -rf nginx
下載:
wget http://nginx.org/download/nginx-1.9.3.tar.gz
解壓:
tar zxvf nginx-1.9.3.tar.gz
進入目錄:
cd nginx-1.9.3
配置
./configure --add-module=../ngx_devel_kit-0.2.19/ --add-module=../lua-nginx-module-0.9.19/ --with-ld-opt="-L /usr/local/lib"
--with-ld-opt="-L /usr/local/lib" 是指定pcre的安裝位置
make
make install
啟動
/usr/local/nginx/sbin/nginx
關閉進程
ps -ef|grep nginx # 第一個
kill -QUIT 主進程號
重啟
/usr/local/nginx/sbin/nginx -s reload
nginx lua整合安裝2