LNMP平滑升级nginx并安装ngx_lua模块教程
#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模块教程的更多相关文章
- 关于centos7和centos6中平滑升级nginx到新版本v1.12.1修复nginx最新漏洞CVE-2017-7529的解决方案
关于centos7和centos6中平滑升级nginx到新版本v1.12.1修复CVE-2017-7529漏洞的解决方案 漏洞描述 2017年7月11日,Nginx官方发布最新的安全公告,在Nginx ...
- Nginx编译安装第三方模块http_substitutions_filter_module2222
Nginx编译安装第三方模块http_substitutions_filter_module Rming -- 阅读 安装 Http 编译 module filter nginx 模块 >> ...
- Nginx编译安装第三方模块http_substitutions_filter_module
Nginx编译安装第三方模块http_substitutions_filter_module 分类:服务器技术 作者:rming 时间:-- . >>ngx_http_substitu ...
- 平滑升级nginx
平滑升级nginx版本技术文档 作者 联系方式 日期 版本号 马坤 852115346@qq.com 2017-12-31 V1.0.0 备注:作者水平有限,难免出现错误.如若发现错误,请您及时与作者 ...
- Linux下平滑升级nginx
一.升级前准备 1.对nginx的配置文件nginx.conf做备份: 2.新建目录/root/nginx,将安装包和脚本上传到该目录下: 二.平滑升级nginx 1.开始编译新版本的nginx cd ...
- 平滑升级nginx到新版本
这里测试一下nginx的平滑升级,以备不时之需 查看nginx版本号: [root@zklf-server01 ~]# /application/nginx/sbin/nginx -V nginx v ...
- 如何升级nodejs版本 安装n模块报错 npm ERR! notsup Unsupported platform
如何升级nodejs版本 首先安装n模块, 输入npm install -g n n模块专门用来管理nodejs的版本. 如果出现npm ERR! notsup Unsupported platfor ...
- CentOS平滑升级Nginx
服务器:CentOS 6.4 64位 升级方案:nginx1.4.0 – nginx1.4.3 Nginx编译后就一个小文件,不带动态库,升级也可以无缝升级,并不影响访问,按下面的命令执行就可以,具体 ...
- nginx编译安装新模块
nginx的模块是需要重新编译nginx,而不是像apache一样配置文件引用.so 这里以安装第三方ngx_http_google_filter_module模块为例 下载第三方扩展模块ngx_ht ...
随机推荐
- [Baltic2003] Gem
[Baltic2003]Gem Time Limit: 2 Sec Memory Limit: 64 MBSubmit: 501 Solved: 320[Submit][Status][Discu ...
- Codeforces 702 D Road to Post Office
题目描述 Vasiliy has a car and he wants to get from home to the post office. The distance which he needs ...
- 原始DAO开发
1,pojo package com.songyan.dao; import com.songyan.pojo.Student; public interface StudentDao { publi ...
- IntelliJ 常用设置
一.智能代码提示忽略大小写 打开设置(CTRL+ALT+S)搜索editor,找到“Code Completion”->点击Case sensitive completion后面的选择框,选中N ...
- 调试手机上网页 (断点 console timeline 选择dom)
用手机看网页,越来越多,手机app套个webview的也很多,那该如何调试手机上的页面了?比如 断点,选dom,console,控制台输出,查看内存,== 嗯,万能的的chrome和safari还是帮 ...
- Zookeeper的功能以及工作原理(转)
本文转自https://www.cnblogs.com/felixzh/p/5869212.html Zookeeper的功能以及工作原理 1.ZooKeeper是什么?ZooKeeper是一个分 ...
- iOS 常用的#define合集
1.定义常量 定义常量的时候最好以小写字母k开头,让人见名知意, (1)导航栏高度:我们都知道iPhone竖屏时候导航栏的高度为44,这时候可以定义一个常量来表示该高度, #define kNaivg ...
- easyui datagrid加载成功之后选定并获取首行数据
//加载成功之后,选定并获取首行数据 onLoadSuccess:function(data){ alert("grid加载成功"); var rows=$('test').dat ...
- 排查java.lang.OutOfMemoryError: GC overhead limit exceeded
帮助客户排查java.lang.OutOfMemoryError: GC overhead limit exceeded错误记录: 具体网址: https://support.oracle.com/e ...
- 设计工作-Axure
1,百度百科 http://baike.baidu.com/view/3332366.htm?fromtitle=axure&fromid=5056136&type=syn 2,官方网 ...