wget http://luajit.org/download/LuaJIT-2.0.2.tar.gz
tar -zxvf LuaJIT-2.0.2.tar.gz
cd LuaJIT-2.0.2
make install PREFIX=/usr/local/LuaJIT/2.0.2
export LUAJIT_LIB=/usr/local/LuaJIT/2.0.2/lib
export LUAJIT_INC=/usr/local/LuaJIT/2.0.2/include/luajit-2.0
echo "/usr/local/LuaJIT/2.0.2/lib" >> /etc/ld.so.conf
ldconfig
安装 ngx_devel_kit 和 lua-nginx-module
wget https://github.com/simpl/ngx_devel_kit/archive/v0.3.0.tar.gz https://github.com/openresty/lua-nginx-module/archive/v0.10.9rc7.tar.gz
tar -zxvf v0.10.9rc7.tar.gz
tar -zxvf v0.3.0.tar.gz
#先make clean,然后在原有的nginx ./configure基础上,添加新的模块
#如果出现undefined reference to `X509_check_host'错误,需要添加--with-openssl选项,指向openssl 1.0.2安装包源码所在的目录。
./configure --add-module=/path/to/ngx_devel_kit-0.3.0 --add-module=/path/to/lua-nginx-module-0.10.9rc7
--with-openssl=/path/to/openssl-1.0.2k
make && make install