簡述模塊安裝過程:
——————————————————————————– ##參考文檔 ——————————————————————————– ##項目地址 https://github.com/chaoslawful/lua-nginx-module ##Lua拓展nginx 參考文檔 http://rhomobi.com/topics/112 ##Nginx與Lua 參考文檔 http://huoding.com/2012/08/31/156 ##HttpLuaModule Nginx Wiki http://wiki.nginx.org/HttpLuaModule ——————————————————————————– ##下載 ——————————————————————————– wget http://luajit.org/download/LuaJIT-2.0.2.tar.gz wget https://github.com/simpl/ngx_devel_kit/archive/v0.2.19.tar.gz wget https://github.com/chaoslawful/lua-nginx-module/archive/v0.9.1.tar.gz wget http://nginx.org/download/nginx-1.4.3.tar.gz ——————————————————————————– ##首先安裝LuaJIT ——————————————————————————- ##install LuaJIT tar -zxvf LuaJIT-2.0.2.tar.gz cd LuaJIT-2.0.2 ./configure make make install export LUAJIT_LIB=/usr/local/lib export LUAJIT_INC=/usr/local/include/luajit-2.0 ——————————————————————————– ##安裝Nginx ——————————————————————————- ##解壓下載下來的ngx_devel_kit以及lua-nginx-module 到/usr/local/src ##install nginx 為方便調試,我添加了echo模塊以及開啟debug模式 ./configure –user=www –group=www \ –prefix=/usr/local/nginx-1.4.3 \ –with-http_stub_status_module \ –with-http_ssl_module \ –with-http_realip_module \ –with-http_perl_module \ –with-pcre=/usr/local/src/pcre-8.12 \ –with-debug \ –add-module=/usr/local/src/lua-nginx-module-0.9.1/ \ –add-module=/usr/local/src/ngx_devel_kit-0.2.19/ \ –add-module=/usr/local/src/echo-nginx-module-0.49/ ——————————————————————————– #啟動nginx ——————————————————————————–
錯誤處理:找不到庫文件,處理方式如下。
echo “/usr/local/lib” > /etc/ld.so.conf.d/usr_local_lib.conf
ldconfig
#重新啟動
/usr/local/nginx-1.4.3/sbin/nginx