• nginx添加编译lua模块


    一 、安装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 检查模块是否添加上
    
  • 相关阅读:
    pbfunc外部函数扩展应用-直接在Datawindow中生成QR二维码,非图片方式
    一、PBNI环境搭建及初步使用
    Powerbuilder编写身份证校验码
    Maven本地安装JAR包组件
    使用SSH通过秘钥登录Linux
    Intellij IDEA下载
    ubuntu使用root用户登录桌面
    Ubuntu安装JDK1.8与配置环境变量
    Ubuntu 安装 JDK 7 / JDK8 的两种方式
    CentOS 7.0关闭默认防火墙启用iptables防火墙
  • 原文地址:https://www.cnblogs.com/bugsbunny/p/8386026.html
Copyright © 2020-2023  润新知