日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

Nginx与Lua利用fpm打成rpm包

發布時間:2023/11/27 生活经验 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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 cores older than 1.6.0 (exclusive) are?not?supported

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 install

3.查看是否缺失模塊

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包的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。