作者:汶汐_782 | 来源:互联网 | 2023-05-26 12:56
Tengine安装tengine兼容nginx配置并启用模块ngx_http_concat_modulengx_http_concat_module该模块类似于apache中的mo
Tengine
查询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