nginx平滑升级、在线添加模块(tengine 动态加载模块)
2014-08-22 10:29
796 查看
http://www.orzace.com/how-to-upgrade-nginx/
下面是nginx替换成tengine再加上lua 模块,(tengine-2.0.1版本暂时无法动态加载lua模块,只能编译加载)
安装系统所需web软件1.下载luajit,官网 http://luajit.org/ wget http://luajit.org/download/LuaJIT-2.0.1.tar.gz tar xzvf LuaJIT-2.0.1.tar.gz
cd LuaJIT-2.0.1
make PREFIX=/usr/local/LuaJIT-2.0.1
make install PREFIX=/usr/local/LuaJIT-2.0.1
2、yum install pcre-devel -y
3、/etc/profileexport LUAJIT_LIB=/usr/local/LuaJIT-2.0.1/lib
export LUAJIT_INC=/usr/local/LuaJIT-2.0.1/include/luajit-2.0
4、tar xzvf tengine-1.5.2.tar.gz
cd tengine-1.5.2
./configure --with-ld-opt="-Wl,-rpath,/usr/local/web/LuaJIT-2.0.1/lib" \
--prefix=/usr/local/tengine --with-http_lua_module \
--with-luajit-inc=/usr/local/LuaJIT-2.0.1/include/luajit-2.0
--with-luajit-lib=/usr/local/LuaJIT-2.0.1/lib
make -j2
make install -j2
5、nginx.conf
location /lua {
default_type 'text/plain';
content_by_lua 'ngx.say("hello, lua")';
}
6、测试
[root@node2 tengine]# curl http://localhost/lua hello, lua
=====================================================================================
如果是别的模块,只需解压,加载即可
tar xvf ngx_cache_purge-1.5.tar.gz
cd /usr/local/tengine
sbin/dso_tool --add-module=/root/ngx_cache_purge-1.5
more /usr/local/tengine/conf/nginx.conf
dso {
load ngx_http_cache_purge_module.so;
}
sbin/nginx -s relaod
sbin/nginx -m
ngx_http_cache_purge_module (shared, 3.1)
验正即可
下面是nginx替换成tengine再加上lua 模块,(tengine-2.0.1版本暂时无法动态加载lua模块,只能编译加载)
安装系统所需web软件1.下载luajit,官网 http://luajit.org/ wget http://luajit.org/download/LuaJIT-2.0.1.tar.gz tar xzvf LuaJIT-2.0.1.tar.gz
cd LuaJIT-2.0.1
make PREFIX=/usr/local/LuaJIT-2.0.1
make install PREFIX=/usr/local/LuaJIT-2.0.1
2、yum install pcre-devel -y
3、/etc/profileexport LUAJIT_LIB=/usr/local/LuaJIT-2.0.1/lib
export LUAJIT_INC=/usr/local/LuaJIT-2.0.1/include/luajit-2.0
4、tar xzvf tengine-1.5.2.tar.gz
cd tengine-1.5.2
./configure --with-ld-opt="-Wl,-rpath,/usr/local/web/LuaJIT-2.0.1/lib" \
--prefix=/usr/local/tengine --with-http_lua_module \
--with-luajit-inc=/usr/local/LuaJIT-2.0.1/include/luajit-2.0
--with-luajit-lib=/usr/local/LuaJIT-2.0.1/lib
make -j2
make install -j2
5、nginx.conf
location /lua {
default_type 'text/plain';
content_by_lua 'ngx.say("hello, lua")';
}
6、测试
[root@node2 tengine]# curl http://localhost/lua hello, lua
=====================================================================================
如果是别的模块,只需解压,加载即可
tar xvf ngx_cache_purge-1.5.tar.gz
cd /usr/local/tengine
sbin/dso_tool --add-module=/root/ngx_cache_purge-1.5
more /usr/local/tengine/conf/nginx.conf
dso {
load ngx_http_cache_purge_module.so;
}
sbin/nginx -s relaod
sbin/nginx -m
ngx_http_cache_purge_module (shared, 3.1)
验正即可
相关文章推荐
- Linux下,Nginx的安装、升级及动态添加模块
- Linux下,Nginx的安装、升级及动态添加模块
- Nginx在线服务状态下平滑升级或新增模块的详细操作记录
- Linux下Nginx的安装、升级及动态添加模块
- 【内核】Linux添加系统调用(静态,非动态加载模块)
- 给动态加载的图片添加延迟加载(附在线demo)
- Nginx > 1.9.11 动态加载模块
- nginx 平滑升级tengine
- CentOS 5.6下将linux内核2.6.18升级到2.6.30,并编译动态加载linux下第一个模块
- nginx php动态编译加载模块.
- nginx启动、重启、重新加载配置文件和平滑升级
- nginx(Tengine)使用——新模块添加使用
- nginx 无缝升级以及nginx添加支持模块,nginx添加proxy_cache 模块
- 玩玩 Nginx 2-----给Nginx添加第三方模块(动态更新upstream)
- 已安装nginx动态添加模块
- nginx 平滑升级及ssl模块升级配置
- 从给编译好的LAMP环境中的PHP添加Xdebug模块分析动态加载
- 编译时向内核添加新设备 模块的方式动态的将驱动加入内核,但这种方式加入的驱动程序,当系统重新启动时, 还需要重新用模块的方式进行插入,如果是系统内常用的设备驱动采用这种方式进行加载, 就会很不方便。
- Nginx添加新模块&平滑重启
- nginx 动态加载(ngx_dso_module)模块