#ngx_lua module项目地址
https://github.com/chaoslawful/lua-nginx-module
在LNMP安装包后,重编译nginx,并添加ngx_lua模块 」Download wget http://luajit.org/download/LuaJIT-2.0.4.tar.gz
wget https://github.com/simpl/ngx_devel_kit/archive/v0.2.19.tar.gz
wget https://github.com/chaoslawful/lua-nginx-module/archive/v0.9.16.tar.gz
wget http://nginx.org/download/nginx-1.9.2.tar.gz 」安装LuaJIT tar -zxvf LuaJIT-2.0..tar.gz
cd LuaJIT-2.0.
make
make install
export LUAJIT_LIB=/usr/local/lib
export LUAJIT_INC=/usr/local/include/luajit-2.0 」copy模块 cp v0.2.19.tar.gz /usr/local/src
cp v0.9.16.tar.gz /usr/local/src
tar -zxvf v0.2.19.tar.gz
tar -zxvf v0.9.16.tar.gz
解压下载下来的ngx_devel_kit以及lua-nginx-module到/usr/local/src目录下,即
/usr/local/src/lua-nginx-module-0.9./
/usr/local/src/ngx_devel_kit-0.2./ 」重新编译Nginx tar -zxvf nginx-1.9..tar.gz
解压nginx包,configure一下(参考LNMP安装包,未加其他修改)
./configure --user=www --group=www --prefix=/usr/local/nginx --with-ld-opt="-Wl,-rpath,$LUAJIT_LIB" --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6 \
--add-module=/usr/local/src/lua-nginx-module-0.9./ \
--add-module=/usr/local/src/ngx_devel_kit-0.2./
OK后make,别make install,否则就覆盖安装 」备份替换 make完后在objs目录下多了个nginx,即新版本的程序
备份旧的nginx程序
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak 新nginx程序覆盖旧的
cp objs/nginx /usr/local/nginx/sbin/nginx 如果提示“cp:cannot create regular file `/usr/local/nginx/sbin/nginx': Text file busy”
建议使用如下语句cp
cp -rfp objs/nginx /usr/local/nginx/sbin/nginx 测试新的nginx程序是否正确
/usr/local/nginx/sbin/nginx -t
nginx: theconfiguration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx:configuration file /usr/local/nginx/conf/nginx.conf test issuccessful 平滑重启nginx
/usr/local/nginx/sbin/nginx -s reload 查看ngixn版本及其编译参数
/usr/local/nginx/sbin/nginx -V 「问题解决」
.如遇到找不到库文件
echo “/usr/local/lib” > /etc/ld.so.conf.d/usr_local_lib.conf
ldconfig
即可
./usr/local/nginx/sbin/nginx: error while loading shared libraries: libluajit-5.1.so.: cannot open shared object file: No such file or directory
在 Nginx 编译时,需要指定 RPATH,记得加入下面选项:
./configure --with-ld-opt="-Wl,-rpath,$LUAJIT_LIB"
或者export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH 需要luafilesystem 的可以参考:为nginx的luajit安装luarocks并安装luafilesystem

LNMP平滑升级nginx并安装ngx_lua模块教程的更多相关文章

  1. 关于centos7和centos6中平滑升级nginx到新版本v1.12.1修复nginx最新漏洞CVE-2017-7529的解决方案

    关于centos7和centos6中平滑升级nginx到新版本v1.12.1修复CVE-2017-7529漏洞的解决方案 漏洞描述 2017年7月11日,Nginx官方发布最新的安全公告,在Nginx ...

  2. Nginx编译安装第三方模块http_substitutions_filter_module2222

    Nginx编译安装第三方模块http_substitutions_filter_module Rming -- 阅读 安装 Http 编译 module filter nginx 模块 >> ...

  3. Nginx编译安装第三方模块http_substitutions_filter_module

    Nginx编译安装第三方模块http_substitutions_filter_module 分类:服务器技术  作者:rming  时间:-- . >>ngx_http_substitu ...

  4. 平滑升级nginx

    平滑升级nginx版本技术文档 作者 联系方式 日期 版本号 马坤 852115346@qq.com 2017-12-31 V1.0.0 备注:作者水平有限,难免出现错误.如若发现错误,请您及时与作者 ...

  5. Linux下平滑升级nginx

    一.升级前准备 1.对nginx的配置文件nginx.conf做备份: 2.新建目录/root/nginx,将安装包和脚本上传到该目录下: 二.平滑升级nginx 1.开始编译新版本的nginx cd ...

  6. 平滑升级nginx到新版本

    这里测试一下nginx的平滑升级,以备不时之需 查看nginx版本号: [root@zklf-server01 ~]# /application/nginx/sbin/nginx -V nginx v ...

  7. 如何升级nodejs版本 安装n模块报错 npm ERR! notsup Unsupported platform

    如何升级nodejs版本 首先安装n模块, 输入npm install -g n n模块专门用来管理nodejs的版本. 如果出现npm ERR! notsup Unsupported platfor ...

  8. CentOS平滑升级Nginx

    服务器:CentOS 6.4 64位 升级方案:nginx1.4.0 – nginx1.4.3 Nginx编译后就一个小文件,不带动态库,升级也可以无缝升级,并不影响访问,按下面的命令执行就可以,具体 ...

  9. nginx编译安装新模块

    nginx的模块是需要重新编译nginx,而不是像apache一样配置文件引用.so 这里以安装第三方ngx_http_google_filter_module模块为例 下载第三方扩展模块ngx_ht ...

随机推荐

  1. 【暴力】Codeforces Round #398 (Div. 2) A. Snacktower

    题意不复述. 用个bool数组记录一下,如果某一天,当前剩下的最大的出现了的话,就输出一段. #include<cstdio> using namespace std; int n; bo ...

  2. python3开发进阶-Django框架中的ORM的常用(增,删,改,查)操作

    阅读目录 如何在Django终端打印SQL语句 如何在Python脚本中调用Django环境 操作方法 单表查询之神奇的下划线 ForeignKey操作 ManyToManyField 聚合查询和分组 ...

  3. 详细User-Agent大全

    目录: Android: Android 0.* Android 1.* Android 2.* Android 3.* Android 4.* Windows Phone OS BlackBerry ...

  4. python的turtle模块画折线图

    代码如下: import turtle yValues = [10.0,7.4,6.4,5.3,4.4,3.7,2.6] def main(): t = turtle.Turtle() t.hidet ...

  5. 搭建SSH框架–使用篇

    创建如下包: action用于响应请求 service则是提供请求的操作 dao用于操作数据库 entity用于映射数据库表 打开DB Browser –> personalCD(创建篇的数据库 ...

  6. How to determine what causes a particular wait type

      By: Paul Randal Posted on: March 18, 2014 6:55 pm   [Edit 2016: Check out my new resource – a comp ...

  7. ARM“庖丁解牛”之存储器管理单元MMU

    转:http://blog.sina.com.cn/s/blog_a07635070101bcbt.html 最近笔者详细地学习了由杜春雷老师编写的<ARM体系结构与编程>.对ARM存储管 ...

  8. SpringMVC——redirect重定向跳转传值

    原文:https://my.oschina.net/u/2273085/blog/398374 spring MVC框架controller间跳转,需重定向.有几种情况:不带参数跳转,带参数拼接url ...

  9. 【mybatis】count 计数查询 + List的IN查询

    mybatis中conut计数的sql怎么在mapper中写? Mapper.java类这么写 @Mapper public interface GoodsBindConfigMappingMappe ...

  10. CentOS--在CentOS安装PHP5.6

    查看centos的版本: [root@localhost ~]# lsb_release -a LSB Version:    :core-3.1-amd64:core-3.1-ia32:core-3 ...