美文网首页
Nginx添加Lua扩展

Nginx添加Lua扩展

作者: 袁先生的笔记 | 来源:发表于2018-10-25 18:19 被阅读0次

环境

系统:CentOS 7.5

准备

编译安装LuaJIT

下载ngx_devel_kit

下载lua-nginx-module

重新编译安装Nginx

  • 查看原来编译参数

    # nginx -V
    ......
    configure arguments: --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module --with-stream
    
  • 添加Lua扩展,重新编译安装

    # export LUAJIT_LIB=/usr/local/lib
    # export LUAJIT_INC=/usr/local/include/luajit-2.0
    
    # cd nginx-1.12.1/
    # ./configure \
    --prefix=/usr/local/nginx \
    --with-http_ssl_module \
    --with-http_stub_status_module \
    --with-stream \
    --add-module=/usr/local/src/ngx_devel_kit-0.3.0 \
    --add-module=/usr/local/src/lua-nginx-module-0.10.13
    
    # make
    # make install
    
  • 重启

    # nginx -t
    # systemctl restart nginx
    

其它

  • 问题

    # 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/lib/libluajit-5.1.so.2 /lib64/
    

相关文章

  • Prometheus监控Nginx

    环境 系统:CentOS 7.5 准备 Nginx添加Lua扩展 Nginx端 下载lua脚本地址:https:/...

  • Nginx添加Lua扩展

    环境 系统:CentOS 7.5 准备 安装Nginx 编译安装LuaJIT 下载地址:http://luajit...

  • Ngxin与lua(十一)

    Lua lua是一个简洁,轻量,可扩展的脚本语言.nginx与lua的优势:充分的结合Nginx的并发处理epol...

  • [深] nginx与lua的开发(28)

    获取全套nginx教程,请访问瓦力博客 lua是一个简洁、轻量、可扩展的脚本语言。nginx+lua开发充分的结合...

  • 基于Nginx&Lua 和Netflix Eureka的

    Zuul for Nginx&Lua 基于Nginx和Lua module。需要安装Nginx Lua模块或者直接...

  • 通过Lua扩展Nginx

    1. Nginx的简介 相关内容,可以查看 【Nginx 负载均衡[https://www.jianshu.com...

  • Nginx安装lua-nginx-module

    使用lua可以为nginx扩展出强大的能力,比如频率限制,访问redis等,本文介绍一下如何安装模块lua-ngi...

  • nginx|lua

    编辑nginx.conf配置文件 在http部分添加配置 编辑lua.conf文件 测试nginx是否正常 重启n...

  • API 网关 Kong 实战

    1.Kong 介绍 Kong 是一款基于 OpenResty(Nginx + Lua 模块)编写的高可用、易扩展的...

  • Agent Telegraf Plugin inputs.log

    初衷 系统中使用lua扩展Nginx,实现Client请求Server的统一接入服务(鉴权,路由)。监控中心会需要...

网友评论

      本文标题:Nginx添加Lua扩展

      本文链接:https://www.haomeiwen.com/subject/haectqtx.html