【nginx安装内置的http_image_filter_module】

devtools/2024/9/23 23:25:01/
http://www.w3.org/2000/svg" style="display: none;">

背景

我的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_14">查看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_modulenginx_43">安装http_image_filter_module之前,先把之前的nginx备份一下吧

命令: mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak

nginx_usrmysoftnginx1190_47">进入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 会覆盖之前的安装。很危险

nginxusrlocalnginxsbin_54">将编译好的nginx放到:usr/local/nginx/sbin/

命令:cp /usr/mysoft/nginx-1.19.0/objs/nginx /usr/local/nginx/sbin/

http_image_filter_module_57">查看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_66">重启nginx

[root@VM-16-17-centos nginx-1.19.0]# nginx -s reload -c /etc/nginx/nginx.conf

注:内容仅供参考,生产环境操作慎用


http://www.ppmy.cn/devtools/13206.html

相关文章

java -spring-引入外部属性文件-初入spring学习

引用外部属性文件 作用 分离配置与代码:将配置信息(如数据库连接信息、服务器地址、端口号等)从代码中分离出来,使得代码更加清晰和专注于业务逻辑的实现。这样,当配置信息需要变更时,我们无需修改和重新…

【C++风云录】精益求精:探索C++开发中的性能优化艺术

超越性能瓶颈:C项目中的质量保证与性能调优策略 前言 在现代软件开发中,自动化测试和质量保证是确保软件质量和稳定性的关键环节。通过使用各种性能分析工具和优化工具,开发人员能够更好地了解程序的行为并改进代码质量。 欢迎订阅专栏&…

38-数组 _ 一维数组

38-1 数组的创建 数组是一组相同类型元素的集合。 数组的创建方式: type_t arr_name [const_n]; //type_t 是指数组的元素类型 //const_n是一个常量表达式,用来指定数组的大小 举例: int arr[10]; char ch[5]; double data[20]; 问&…

JavaEE >> Spring(2)

前面已经介绍了 Spring 的基本使用以及创建,本文将介绍使用注解的方式实现对 Spring 更简单的存储对象和读取对象. 将对象存储到 Spring 中 创建 Spring 项目 前面已经做过详细步骤,此处不再赘述. 链接在此 Spring 基本使用及创建 pom.xml 和 Spring…

云服务器部署Springboot项目

前端项目打包 修改ip地址 在控制台输入npm run build:prod 会产生dist文件 将dist文件中的内容移动至/usr/local/nginx/html目录下 后端项目打包 修改ip地址 执行clean操作 执行install操作 将生成的target文件中的jar包移动至/usr/local/src目录下 启动 注意⚠️&#xff…

PVE虚拟机隐藏状态栏虚拟设备

虚拟机启动后,状态栏会出现一些虚拟设备,点击弹出会导致虚拟机无法使用。 解决方案: 1、在桌面新建disable_virtio_removale.bat文件,内容如下: ECHO OFF FOR /f %%A IN (reg query "HKLM\SYSTEM\CurrentContro…

C++ //练习 13.11 为前面练习中的HasPtr类添加一个析构函数。

C Primer(第5版) 练习 13.11 练习 13.11 为前面练习中的HasPtr类添加一个析构函数。 环境:Linux Ubuntu(云服务器) 工具:vim 代码块 class HasPtr{ public:HasPtr(const std::string &s std::stri…

Unity之XR Interaction Toolkit如何在VR中实现渐变黑屏效果

前言 做VR的时候,有时会有跳转场景,切换位置,切换环境,切换进度等等需求,此时相机的画面如果不切换个黑屏,总会感觉很突兀。刚好Unity的XR Interaction Toolkit插件在2.5.x版本,出了一个TunnelingVignette的效果,我们今天就来分析一下他是如何使用的,然后我们自己再来…