微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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动态模块编译到安装目录

./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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐