這篇文章主要介紹了關於Nginx編譯安裝Lua模組,有著一定的參考價值,現在分享給大家,有需要的朋友可以參考一下
1、 LuaJIT
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 export LUAJIT_LIB=/usr/local/LuaJIT/lib export LUAJIT_INC=/usr/local/LuaJIT/include/luajit-2.0
2、ngx_devel_kit與lua-nginx-module
cd /opt/download wget https://github.com/simpl/ngx_devel_kit/archive/v0.3.0.tar.gz wget https://github.com/openresty/lua-nginx-module/archive/v0.10.9rc7.tar.gz # 分别解压
3、 重新編譯Nginx
cd /opt/download wget http://nginx.org/download/nginx-1.14.0.tar.gz tar -zxvf nginx-1.14.0.tar.gz cd nginx-1.14.0 ./configure --add-module=/opt/download/ngx_devel_kit-0.3.0 --add-module=/opt/download/lua-nginx-module-0.10.9rc7 # 如若出现: # error: the HTTP gzip module requires the zlib library. # yum install zlib zlib-devel 一下即可 make -j 4 && make install
4、 載入lua函式庫,加入到ld.so.conf檔案
echo "/usr/local/LuaJIT/lib" >> /etc/ld.so.conf # 然后执行如下命令: ldconfig
相關建議:
以上是Nginx編譯安裝Lua模組的詳細內容。更多資訊請關注PHP中文網其他相關文章!