【nginx安装内置的http_image_filter_module】

背景

我的nginx源码目录为:/usr/mysoft/nginx-1.19.0/

nginx的目录为:/usr/local/nginx/sbin

命令:[root@VM-16-17-centos sbin]# cd /usr/sbin/

lrwxrwxrwx 1 root root 27 Apr 17 23:13 nginx -> /usr/local/nginx/sbin/nginx

进入源码目录

root@VM-16-17-centos nginx-1.19.0\]# cd /usr/mysoft/nginx-1.19.0/ 查看我的系统信息 \[root@VM-16-17-centos sbin\]# **uname -a** Linux VM-16-17-centos 3.10.0-1160.114.2.el7.x86_64 #1 SMP Wed Mar 20 15:54:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux 本文在之前已经编译安装nginx的基础上进行操作, 本文的主角为:http_image_filter_module(注:该模块为nginx的内置模块,不需要下载) ## 查看nginx的内置模块 ./configure --help 下面列出了 那个模块可以被启用,哪些模块已经默认启用了,你可以禁止启用他。 --with-\*\*\*表示可以被启用,没有默认启用的模块, --without-\*\*\*表示已经默认被启用,你可以禁止启用的模块 --with-select_module enable select module --without-select_module disable select module --with-poll_module enable poll module --without-poll_module disable poll module --with-threads enable thread pool support --with-file-aio enable file AIO support --with-http_ssl_module enable ngx_http_ssl_module --with-http_v2_module enable ngx_http_v2_module --with-http_realip_module enable ngx_http_realip_module --with-http_addition_module enable ngx_http_addition_module --with-http_xslt_module enable ngx_http_xslt_module --with-http_xslt_module=dynamic enable dynamic ngx_http_xslt_module --with-http_image_filter_module enable ngx_http_image_filter_module --with-http_image_filter_module=dynamic enable dynamic ngx_http_image_filter_module --with-http_geoip_module enable ngx_http_geoip_module ## 查看已经安装的模块 命令: nginx -V nginx version: nginx/1.19.0 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) built with OpenSSL 1.0.2k-fips 26 Jan 2017 TLS SNI support enabled configure arguments: --add-module=/usr/mysoft/nginx-rtmp-module-master --prefix=/usr/local/nginx --with-debug ## 安装http_image_filter_module之前,先把之前的nginx备份一下吧 命令: mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak ## 进入nginx的源码目录: /usr/mysoft/nginx-1.19.0/ 编译安装,需要将之前的nginx的已经安装的模块复制上,再增加:http_image_filter_module 命令 ./configure --prefix=/usr/local/nginx --add-module=/usr/mysoft/nginx-rtmp-module-master --prefix=/usr/local/nginx --with-debug --with-http_image_filter_module ## 命令:make 注意不是make install,make install 会覆盖之前的安装。很危险 ## 将编译好的nginx放到:usr/local/nginx/sbin/ 命令:cp /usr/mysoft/nginx-1.19.0/objs/nginx /usr/local/nginx/sbin/ ## 查看http_image_filter_module是否已经安装完成 \[root@VM-16-17-centos nginx-1.19.0\]# nginx -V nginx version: nginx/1.19.0 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) built with OpenSSL 1.0.2k-fips 26 Jan 2017 TLS SNI support enabled configure arguments: --prefix=/usr/local/nginx --add-module=/usr/mysoft/nginx-rtmp-module-master --prefix=/usr/local/nginx --with-debug **--with-http_image_filter_module** \[root@VM-16-17-centos nginx-1.19.0\]# ## 重启nginx \[root@VM-16-17-centos nginx-1.19.0\]# nginx -s reload -c /etc/nginx/nginx.conf 注:内容仅供参考,生产环境操作慎用

相关推荐
Johnstons1 小时前
读懂 TCP 标志位:网络运维中的“信号灯”
运维·网络·tcp/ip
坚定的共产主义生产设备永不宕机2 小时前
网络层协议(IPV4报头)
运维·服务器·网络
weixin_505154462 小时前
Bowell Studio:重塑工业互联网时代的装配制造与运维检修
运维·数据库·人工智能·制造·数字孪生·3d产品配置器·3d交互展示
kc胡聪聪2 小时前
nginx的核心功能
服务器·nginx
sbjdhjd2 小时前
RHCE | Web 服务器与 Nginx 全栈详解
linux·nginx·http·云原生·oracle·架构·web
小云数据库服务专线2 小时前
linux awk使用
linux·运维·服务器
执笔为剑3 小时前
1.2、docker环境部署
运维·docker·容器
杰克崔3 小时前
preempt_count()、in_interrupt()等上下文判断常用函数及宏介绍
linux·运维·服务器·车载系统
智能运维指南3 小时前
信创背景下,国产 DevOps 平台如何实现真正的“全栈适配”?
运维·devops
代码派3 小时前
NineData社区版:免费+本地化部署,满足数据库DevOps、数据复制与一致性对比的数据库管理平台
运维·数据库·database·devops·数据库管理工具·ninedata·数据库迁移