Tengine动态模块扩展

Tengine

  • 安装tengine兼容nginx配置并启用模块ngx_http_concat_module
  • ngx_http_concat_module 该模块类似于apache中的mod_concat模块,用于合并多个文件在一个响应报文中。
  • --with-http_concat_module enable ngx_http_concat_module 静态模块
  • --with-http_concat_module=shared enable ngx_http_concat_module (shared) 动态模块

    2.安装

    yum install -y vim lrzsz tree screen psmisc lsof tcpdump wget ntpdate gcc gcc-c++ glibc glibc-devel pcre pcre-devel openssl openssl-devel systemd-devel net-tools iotop bc zip unzip zlib-devel bash-completion nfs-utils automake libxml2 libxml2-devel libxslt libxslt-devel perl perl-ExtUtils-Embed
    cd /usr/local/src
    wget http://tengine.taobao.org/download/tengine-2.1.2.tar.gz
    cd tengine-2.1.2

查询nginx的配置,并删掉不支持的模块

/apps/nginx/sbin/nginx -V

在tengine-2.1.2目录下编译安装

./configure --prefix=/apps/tengine --user=nginx --group=nginx --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre --add-module=/usr/local/src/echo-nginx-module
make && make install

在tengine配置文件中导入nginx配置文件

vim /apps/tengine/conf/nginx.conf
include /apps/nginx/conf/server/*.conf;
}

3.将ngx_http_concat_module静态直接编译到tengine

./configure --prefix=/apps/tengine --user=nginx --group=nginx --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre --add-module=/usr/local/src/echo-nginx-module --with-http_concat_module
make && make install

在配置文件location中打开concat模块

concat on;
/apps/tengine/sbin/nginx -t
/apps/tengine/sbin/nginx -s start

4.删除tengine重新安装tengine,ngx_http_concat_module动态直接编译到tengine

在tengine-2.1.2目录下编译安装

./configure --prefix=/apps/tengine --user=nginx --group=nginx --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre --add-module=/usr/local/src/echo-nginx-module
make && make install

在tengine配置文件中导入nginx配置文件

vim /apps/tengine/conf/nginx.conf
include /apps/nginx/conf/server/*.conf;
}

将ngx_http_concat_module动态模块编译到安装目录

  • 动态模块可在不停止tengine(nginx),在配置文件中直接调用模块重新载入配置文件完成对tengine的功能扩展
./configure --prefix=/apps/tengine --user=nginx --group=nginx --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre --add-module=/usr/local/src/echo-nginx-module --with-http_concat_module=shared
make dso_install
ll /apps/tengine/modules/
rwxr-xr-x 1 root root 93264 Jun  1 10:42 ngx_http_concat_module.so
vim /apps/tengine/conf/nginx.conf
dso {
load ngx_http_concat_module.so;
}
/apps/tengine/sbin/nginx -t
/apps/tengine/sbin/nginx -s start

转载于:https://blog.51cto.com/13586612/2403639

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值