Nginx与Lua利用fpm打成rpm包
生活随笔
收集整理的這篇文章主要介紹了
Nginx与Lua利用fpm打成rpm包
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.下載相關軟件
需要軟件有:Nginx,LuaJIT,ngx_devel_kit,ngx_lua等安裝文件
安裝Lua或者LuaJIT都是可以的,但是出于效率的考慮,推薦安裝LuaJIT
shell> wget http://luajit.org/download/LuaJIT-<VERSION>.tar.gz shell> tar zxvf LuaJIT-<VERSION>.tar.gz shell> cd LuaJIT-<VERSION> shell> make shell> make install
因為安裝在缺省路徑,所以LuaJIT對應的lib,include均在/usr/local目錄里。
shell> export LUAJIT_LIB=/usr/local/lib shell> export LUAJIT_INC=/usr/local/include/luajit-<VERSION>
注意:lua模塊支持的nginx版本
Nginx Compatibility The latest version of this module is compatible with the following versions of Nginx:- 1.11.x (last tested: 1.11.2)
- 1.10.x
- 1.9.x (last tested: 1.9.15)
- 1.8.x
- 1.7.x (last tested: 1.7.10)
- 1.6.x
nginx編譯參數:
./configure --prefix=/usr/local/nginx-lua-1.11.7 --with-pcre --with-http_stub_status_module --with-http_gzip_static_module --add-module=/opt/lua-nginx-module-0.10.7 --add-module=/opt/ngx_devel_kit-0.3.0 --with-ld-opt="-Wl,-rpath,/usr/local/lib"2.編譯安裝
make -j2 && make install3.查看是否缺失模塊
ldd nginx 試著啟動一下Nginx看看,如果你運氣不好的話,可能會遇到如下錯誤: cannot open shared object file: No such file or directory 這是神馬情況?可以用ldd命令來看看: shell> ldd /path/to/nginx libluajit-<VERSION>.so => not found 此類問題通常使用ldconfig命令就能解決: shell> echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf shell> ldconfig 再試著啟動Nginx看看,應該就OK了。4.fpm打包
fpm打包教程網上有很多,這里就不重復了 github上有現成的開源項目 http://openresty.org/cn/?參考鏈接:
https://github.com/openresty/lua-nginx-module http://huoding.com/2012/08/31/156 http://openresty.org/cn/轉載于:https://www.cnblogs.com/zhanmeiliang/p/6202856.html
總結
以上是生活随笔為你收集整理的Nginx与Lua利用fpm打成rpm包的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 发财树多少钱一棵
- 下一篇: viewport使用 html5