tengine动态加载lua模块
由于之前已经编译好了tengine,懒得重新编译所以选择用dso来搞
首先搞一下lua
wget http://luajit.org/download/LuaJIT-2.0.3.tar.gz
tar zxf -C LuaJIT-2.0.3.tar.gz
cd /usr/local/LuaJIT-2.0.3
make install PREFIX=/usr/local/luajit
vi /etc/profile
export LUAJIT_LIB=/usr/local/luajit/lib
export LUAJIT_INC=/usr/local/luajit/include/luajit-2.0
source /etc/profile
下载lua-nginx模块
cd /opt
git clone https://github.com/chaoslawful/lua-nginx-module.git
编译
/opt/nginx/sbin/dso_tool --add-module=/opt/lua-nginx-module/
nginx配置
vi /opt/nginx/conf/nginx.conf 增加
dso {
load ngx_http_lua_module.so;
}
本文出自 “运维CC” 博客,请务必保留此出处http://chaohl.blog.51cto.com/9998592/1621200
原文地址:http://chaohl.blog.51cto.com/9998592/1621200