网上找了好多文档,搞了一个半小时才好
分享一下简便方法:
/usr/local/src/是我的模块存放地
下载解压:
wget https://github.com/simplresty/ngx_devel_kit/archive/v0.3.0.tar.gz -C /usr/local/src/
tar xzvf v0.3.0.tar.gz
wget https://github.com/openresty/lua-nginx-module/archive/v0.10.11.tar.gz -C /usr/local/src/
tar xvf v0.10.11.tar.gz
下载lua:(/opt/data/nginx/是我的nginx安装路径)
wget http://luajit.org/download/LuaJIT-2.0.5.tar.gz
tar xzvf LuaJIT-2.0.5.tar.gz
cd LuaJIT-2.0.5
make PREFIX=/opt/data/nginx/lua/luajit
make install PREFIX=/opt/data/nginx/lua/luajit
然后进入源码包
cd /usr/local/src/nginx-1.14.0
./configure
–prefix=/opt/data/nginx
–with-http_stub_status_module
–with-http_ssl_module
–with-stream
–add-module=/usr/local/src/echo-nginx-module-0.61
–add-module=/usr/local/src/ngx_devel_kit-0.3.0
–add-module=/usr/local/src/lua-nginx-module-0.10.11
make &make install
cp /opt/data/nginx/sbin/nginx /opt/programs/nginx_1.12.2/sbin/nginx.bak 备份
systemctl stop nginx #t停止以前的
cp objs/nginx /opt/data/nginx/sbin/ #覆盖之前的
nginx -t 检测是否安装好
nginx -t
nginx: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory
解决:
ln -s /usr/local/luajit/lib/libluajit-5.1.so.2 /lib64/
nginx -V 检查模块是否添加上
欢迎探讨:
QQ:2858226830
|
请发表评论