码迷,mamicode.com
首页 > 其他好文 > 详细

nginx添加编译lua模块

时间:2018-01-30 20:04:19      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:openresty   figure   imp   添加   ice   tls   uil   obj   --   

一 、安装LuaJit

1、下载LuaJit

# wget http://luajit.org/download/LuaJIT-2.0.5.tar.gz

2、编译安装

# tar xzvf LuaJIT-2.0.5.tar.gz
# cd LuaJIT-2.0.5
# make PREFIX=/opt/programs/nginx_1.12.2/lua/luajit
# make install PREFIX=/opt/programs/nginx_1.12.2/lua/luajit

二、下载 ngx_devel_kit (NDK)

# wget https://github.com/simplresty/ngx_devel_kit/archive/v0.3.0.tar.gz
# tar xzvf v0.3.0.tar.gz

三、下载 ngx_lua

# wget https://github.com/openresty/lua-nginx-module/archive/v0.10.11.tar.gz
# tar xvf v0.10.11.tar.gz

四、查看之前编译参数

#./nginx -V
nginx version: nginx/1.12.2
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --prefix=/opt/programs/nginx_1.12.2 --with-http_realip_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_ssl_module --with-threads --with-http_v2_module --with-http_addition_module --with-http_dav_module --with-file-aio --with-http_gunzip_module --add-module=nginx_upstream_check_module-master

五、集成添加lua

# export LUAJIT_LIB=/opt/programs/nginx_1.12.2/lua/luajit/lib
# export LUAJIT_INC=/opt/programs/nginx_1.12.2/lua/luajit/include/luajit-2.0
# ./configure --prefix=/opt/programs/nginx_1.12.2 --with-http_realip_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_ssl_module --with-threads --with-http_v2_module --with-http_addition_module --with-http_dav_module --with-file-aio --with-http_gunzip_module --add-module=nginx_upstream_check_module-master --with-ld-opt="-Wl,-rpath,/opt/programs/nginx_1.12.2/lua/luajit/lib" --add-module=/opt/programs/nginx_1.12.2/lua/ngx_devel_kit-0.3.0/ --add-module=/opt/programs/nginx_1.12.2/lua/lua-nginx-module-0.10.11/
# make 
# cp /opt/programs/nginx_1.12.2/sbin/nginx /opt/programs/nginx_1.12.2/sbin/nginx.bak 备份
# service nginx stop
#cp objs/nginx /opt/programs/nginx_1.12.2/sbin/
cp: overwrite ‘/opt/programs/nginx_1.12.2/sbin/nginx’? y
# nginx -V 检查模块是否添加上

nginx添加编译lua模块

标签:openresty   figure   imp   添加   ice   tls   uil   obj   --   

原文地址:https://www.cnblogs.com/bugsbunny/p/8386026.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!