您的位置:首页 > 其它

Tengine动态模块扩展

2019-06-01 17:23 2416 查看

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: