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 ...
随机推荐
- Codeforces 138D World of Darkraft(Multi-Nim)
[题目链接] http://codeforces.com/problemset/problem/138/D [题目大意] H*W的棋盘中每个点都是L.R.X三者之一,两人轮流选一个点, 若为L则向左下 ...
- python3 开发面试题(常用模块以及第三方库)6.5
""" 1. os和sys都是干什么的? 2. 你工作中都用过哪些内置模块? 3. 有没有用过functools模块? """ #sys模块 ...
- [CF865C]Gotta Go Fast
题目大意: 一个游戏关卡有$n(n\le50)$个任务,若在$m$秒内按顺序完成所有任务则算作通过当前关卡.每个关卡有三个属性$a_i,b_i,p_i(1\le a_i<b_i\le100,80 ...
- 数据挖掘经典算法——K-means算法
算法描述 K-means算法是一种被广泛使用的基于划分的聚类算法,目的是将n个对象会分成k个簇.算法的具体描述如下: 随机选取k个对象作为簇中心: Do 计算所有对象到这k个簇中心的距离,将距离最近的 ...
- Linux下的/etc/crontab文件和crontab -e命令区别及Crontab命令详解(转)
/etc/crontab文件和crontab -e命令区别 1.格式不同 前者 # For details see crontabs # Example of job definition: # .- ...
- easyui中一键清空搜索栏搜索条件的思路
$.fn.clearAllSearchPanel = function () { var $id = $(this); $id.find(".form-control").each ...
- mongodb_profier
http://docs.mongodb.org/manual/reference/database-profiler/ 一.获取.设置profile(profile用collection存储数据) d ...
- redis_安装及使用
一.文档资料 1.官方网站:http://redis.io/ 2.官方文档:http://redis.io/documentation 3.常用命令文档:http: ...
- UI 层级问题
UI 用overlay的话 不会有自己的camre 直接画到backbuffer上 比较推荐 分层的事情就用sorting order解决就可以了 下一步就是能不能拿到 ugui的shader了 UI ...
- [Pycharm] Interpreter setting in Pycharm
From: http://blog.csdn.net/u013088062/article/details/50135135 From: http://blog.csdn.net/u013088062 ...