Nginx重新编译并添加模块

1.查询Nginx配置参数

        作用:一是检查所需模块是否已安装,二是将configure arguments: 后面的参数复制出来并保存,因为等会重新编译时还需将这些模块一同添加进去。

[root@reader ~]# nginx -V
nginx version: nginx/1.24.0
built by gcc 8.5.0 20210514 (Red Hat 8.5.0-4) (GCC) 
built with OpenSSL 1.1.1k  FIPS 25 Mar 2021
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-threads --with-http_ssl_module --with-http_gzip_static_module
[root@reader ~]# 

2.添加所需模块

进入Nginx源码包目录下,使用./configure --help指令查询需要配置的参数。

[root@reader ~]# cd /usr/soft/nginx-1.24.0/
[root@reader nginx-1.24.0]# ./configure --help--help                             print this message--prefix=PATH                      set installation prefix--sbin-path=PATH                   set nginx binary pathname--modules-path=PATH                set modules path--conf-path=PATH                   set nginx.conf pathname--error-log-path=PATH              set error log pathname--pid-path=PATH                    set nginx.pid pathname--lock-path=PATH                   set nginx.lock pathname--user=USER                        set non-privileged user forworker processes--group=GROUP                      set non-privileged group forworker processes--build=NAME                       set build name--builddir=DIR                     set build directory--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=dynamicenable dynamic ngx_http_image_filter_module--with-http_geoip_module           enable ngx_http_geoip_module--with-http_geoip_module=dynamic   enable dynamic ngx_http_geoip_module--with-http_sub_module             enable ngx_http_sub_module--with-http_dav_module             enable ngx_http_dav_module--with-http_flv_module             enable ngx_http_flv_module--with-http_mp4_module             enable ngx_http_mp4_module--with-http_gunzip_module          enable ngx_http_gunzip_module--with-http_gzip_static_module     enable ngx_http_gzip_static_module--with-http_auth_request_module    enable ngx_http_auth_request_module--with-http_random_index_module    enable ngx_http_random_index_module--with-http_secure_link_module     enable ngx_http_secure_link_module--with-http_degradation_module     enable ngx_http_degradation_module--with-http_slice_module           enable ngx_http_slice_module--with-http_stub_status_module     enable ngx_http_stub_status_module--without-http_charset_module      disable ngx_http_charset_module--without-http_gzip_module         disable ngx_http_gzip_module--without-http_ssi_module          disable ngx_http_ssi_module--without-http_userid_module       disable ngx_http_userid_module--without-http_access_module       disable ngx_http_access_module--without-http_auth_basic_module   disable ngx_http_auth_basic_module--without-http_mirror_module       disable ngx_http_mirror_module--without-http_autoindex_module    disable ngx_http_autoindex_module--without-http_geo_module          disable ngx_http_geo_module--without-http_map_module          disable ngx_http_map_module--without-http_split_clients_module disable ngx_http_split_clients_module--without-http_referer_module      disable ngx_http_referer_module--without-http_rewrite_module      disable ngx_http_rewrite_module--without-http_proxy_module        disable ngx_http_proxy_module--without-http_fastcgi_module      disable ngx_http_fastcgi_module--without-http_uwsgi_module        disable ngx_http_uwsgi_module--without-http_scgi_module         disable ngx_http_scgi_module--without-http_grpc_module         disable ngx_http_grpc_module--without-http_memcached_module    disable ngx_http_memcached_module--without-http_limit_conn_module   disable ngx_http_limit_conn_module--without-http_limit_req_module    disable ngx_http_limit_req_module--without-http_empty_gif_module    disable ngx_http_empty_gif_module--without-http_browser_module      disable ngx_http_browser_module--without-http_upstream_hash_moduledisable ngx_http_upstream_hash_module--without-http_upstream_ip_hash_moduledisable ngx_http_upstream_ip_hash_module--without-http_upstream_least_conn_moduledisable ngx_http_upstream_least_conn_module--without-http_upstream_random_moduledisable ngx_http_upstream_random_module--without-http_upstream_keepalive_moduledisable ngx_http_upstream_keepalive_module--without-http_upstream_zone_moduledisable ngx_http_upstream_zone_module--with-http_perl_module            enable ngx_http_perl_module--with-http_perl_module=dynamic    enable dynamic ngx_http_perl_module--with-perl_modules_path=PATH      set Perl modules path--with-perl=PATH                   set perl binary pathname--http-log-path=PATH               set http access log pathname--http-client-body-temp-path=PATH  set path to storehttp client request body temporary files--http-proxy-temp-path=PATH        set path to storehttp proxy temporary files--http-fastcgi-temp-path=PATH      set path to storehttp fastcgi temporary files--http-uwsgi-temp-path=PATH        set path to storehttp uwsgi temporary files--http-scgi-temp-path=PATH         set path to storehttp scgi temporary files--without-http                     disable HTTP server--without-http-cache               disable HTTP cache--with-mail                        enable POP3/IMAP4/SMTP proxy module--with-mail=dynamic                enable dynamic POP3/IMAP4/SMTP proxy module--with-mail_ssl_module             enable ngx_mail_ssl_module--without-mail_pop3_module         disable ngx_mail_pop3_module--without-mail_imap_module         disable ngx_mail_imap_module--without-mail_smtp_module         disable ngx_mail_smtp_module--with-stream                      enable TCP/UDP proxy module--with-stream=dynamic              enable dynamic TCP/UDP proxy module--with-stream_ssl_module           enable ngx_stream_ssl_module--with-stream_realip_module        enable ngx_stream_realip_module--with-stream_geoip_module         enable ngx_stream_geoip_module--with-stream_geoip_module=dynamic enable dynamic ngx_stream_geoip_module--with-stream_ssl_preread_module   enable ngx_stream_ssl_preread_module--without-stream_limit_conn_module disable ngx_stream_limit_conn_module--without-stream_access_module     disable ngx_stream_access_module--without-stream_geo_module        disable ngx_stream_geo_module--without-stream_map_module        disable ngx_stream_map_module--without-stream_split_clients_moduledisable ngx_stream_split_clients_module--without-stream_return_module     disable ngx_stream_return_module--without-stream_set_module        disable ngx_stream_set_module--without-stream_upstream_hash_moduledisable ngx_stream_upstream_hash_module--without-stream_upstream_least_conn_moduledisable ngx_stream_upstream_least_conn_module--without-stream_upstream_random_moduledisable ngx_stream_upstream_random_module--without-stream_upstream_zone_moduledisable ngx_stream_upstream_zone_module--with-google_perftools_module     enable ngx_google_perftools_module--with-cpp_test_module             enable ngx_cpp_test_module--add-module=PATH                  enable external module--add-dynamic-module=PATH          enable dynamic external module--with-compat                      dynamic modules compatibility--with-cc=PATH                     set C compiler pathname--with-cpp=PATH                    set C preprocessor pathname--with-cc-opt=OPTIONS              set additional C compiler options--with-ld-opt=OPTIONS              set additional linker options--with-cpu-opt=CPU                 build for the specified CPU, valid values:pentium, pentiumpro, pentium3, pentium4,athlon, opteron, sparc32, sparc64, ppc64--without-pcre                     disable PCRE library usage--with-pcre                        force PCRE library usage--with-pcre=DIR                    set path to PCRE library sources--with-pcre-opt=OPTIONS            set additional build options for PCRE--with-pcre-jit                    build PCRE with JIT compilation support--without-pcre2                    do not use PCRE2 library--with-zlib=DIR                    set path to zlib library sources--with-zlib-opt=OPTIONS            set additional build options for zlib--with-zlib-asm=CPU                use zlib assembler sources optimizedfor the specified CPU, valid values:pentium, pentiumpro--with-libatomic                   force libatomic_ops library usage--with-libatomic=DIR               set path to libatomic_ops library sources--with-openssl=DIR                 set path to OpenSSL library sources--with-openssl-opt=OPTIONS         set additional build options for OpenSSL--with-debug                       enable debug logging[root@reader nginx-1.24.0]# 

        安装http_stub_status_module 模块,预编译

[root@reader nginx-1.24.0]# ./configure --prefix=/usr/local/nginx --with-threads --with-http_ssl_module --with-http_gzip_static_module --with-http_stub_status_module

3.执行make命令进行编译

        因为我们已经安装过nginx,所有这里只需make,不需要make install。如果是首次安装,请查看另一篇博文。

4.停止Nginx并备份可执行程序

[root@reader nginx-1.24.0]# nginx -s stop
[root@reader nginx-1.24.0]# ps -ef | grep nginx
root     13343 10455  0 22:22 pts/0    00:00:00 grep --color=auto nginx
[root@reader nginx-1.24.0]# cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx_20231105.bak
[root@reader nginx-1.24.0]# cd /usr/local/nginx/sbin/
[root@reader sbin]# ll
total 11664
-rwxr-xr-x 1 root root 5971720 Nov  3 23:35 nginx
-rwxr-xr-x 1 root root 5971720 Nov  5 22:22 nginx_20231105.bak

5.覆盖可执行程序

        用第3步重新编译后的可执行程序覆盖旧的可执行程序

[root@reader sbin]# cd /usr/soft/nginx-1.24.0/objs/ && ll
total 6028
-rw-r--r-- 1 root root   19235 Nov  5 22:14 autoconf.err
-rw-r--r-- 1 root root   43108 Nov  5 22:14 Makefile
-rwxr-xr-x 1 root root 6018504 Nov  5 22:20 nginx
-rw-r--r-- 1 root root    5537 Nov  5 22:20 nginx.8
-rw-r--r-- 1 root root    7435 Nov  5 22:14 ngx_auto_config.h
-rw-r--r-- 1 root root     657 Nov  5 22:14 ngx_auto_headers.h
-rw-r--r-- 1 root root    6385 Nov  5 22:14 ngx_modules.c
-rw-r--r-- 1 root root   53304 Nov  5 22:20 ngx_modules.o
drwxr-xr-x 9 root root      91 Nov  3 23:23 src
[root@reader objs]# cp /usr/soft/nginx-1.24.0/objs/nginx /usr/local/nginx/sbin/
cp: overwrite '/usr/local/nginx/sbin/nginx'? yes
[root@reader objs]# cd /usr/local/nginx/sbin/ && ll
total 11712
-rwxr-xr-x 1 root root 6018504 Nov  5 22:25 nginx
-rwxr-xr-x 1 root root 5971720 Nov  5 22:22 nginx_20231105.bak
[root@reader sbin]# 

6.查询Nginx配置参数并启动

        http_stub_status_module模块安装成功。

[root@reader sbin]# nginx -V
nginx version: nginx/1.24.0
built by gcc 8.5.0 20210514 (Red Hat 8.5.0-4) (GCC) 
built with OpenSSL 1.1.1k  FIPS 25 Mar 2021
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-threads --with-http_ssl_module --with-http_gzip_static_module --with-http_stub_status_module
[root@reader sbin]# nginx
[root@reader sbin]# ps -ef | grep nginx
root     13417     1  0 22:26 ?        00:00:00 nginx: master process nginx
nobody   13418 13417  0 22:26 ?        00:00:00 nginx: worker process
nobody   13419 13417  0 22:26 ?        00:00:00 nginx: worker process
root     13518 10455  0 22:37 pts/0    00:00:00 grep --color=auto nginx
[root@reader sbin]# 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/131583.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

win10 + cmake3.17 + vs2017编译osgearth2.7.0遇到的坑

坑1&#xff1a;debug模式下生成osgEarthAnnotation时 错误&#xff1a;xmemory0(881): error C2440: “初始化”: 无法从“std::pair<const _Kty,_Ty>”转换为 to _Objty 出错位置&#xff1a;src/osgEarthFeatures/FeatureSourceIndexNode.cpp 解决办法&#xff1a; …

Docker Compose学习笔记

本文有以下几部分内容&#xff1a; Docker Compose用来做什么&#xff1f;Docker compose使用三步骤Docker Compose安装和查看版本Docker Compose常用命令Compose文档怎么写&#xff1f; Docker Compose用来做什么&#xff1f; Docker Compose 是Docker官方的开源项目。 Co…

镭神智能C16的ROS1驱动的安装方法

github 代码链接 git clone -b C16_V4.0 https://github.com/Lslidar/Lslidar_ROS1_driver.gitroslaunch lslidar_driver lslidar_c16.launch

unity 使用TriLib插件动态读取外部模型

最近在做动态加载读取外部模型的功能使用了triLib插件&#xff0c;废话不多说直接干货。 第一步下载导入插件&#xff0c;直接分享主打白嫖共享&#xff0c;不搞花里胡哨的。 链接&#xff1a;https://pan.baidu.com/s/1DK474wSrIZ0R6i0EBh5V8A 提取码&#xff1a;tado 导入后第…

Linux Swap配置以及使用

Linux Swap配置以及使用 显示系统的内存和交换空间使用情况列出当前启用的交换空间及其相关信息&#xff0c;如设备路径、类型和大小。显示当前启用的交换空间及其详细信息&#xff0c;包括设备路径、类型和大小。创建交换文件重启后失效修复 显示系统的内存和交换空间使用情况…

高级深入--day45

官方站点&#xff1a;GitHub - rmax/scrapy-redis: Redis-based components for Scrapy. scrapy-redis的官方文档写的比较简洁&#xff0c;没有提及其运行原理&#xff0c;所以如果想全面的理解分布式爬虫的运行原理&#xff0c;还是得看scrapy-redis的源代码才行。 scrapy-r…

Spring Cloud之Seata的学习

目录 案例准备 分布式事务 基本理论 CAP定理 BASE理论 Seata 部署TC服务 数据库准备 修改Nacos配置并导入信息 启动Seata 集成Seata XA模式原理 Seata的XA实现 优点 缺点 实现 AT模式原理 AT模式的脏写问题 Seata的AT实现 XA与AT的区别 TCC模式原理 空回…

有人物联网模块连接阿里云物联网平台的方法

摘要&#xff1a;本文介绍有人物联网模块M100连接阿里云的参数设置&#xff0c;作为说明书的补充。 没有阿里云功能需求的请略过本文&#xff0c;不要浪费您宝贵的时间。 网络选择LTE&#xff0c;请先确保插入的SIM卡有流量。 接下来配置阿里云云服务。如下图所示&#xff0c;…

windows mysql安装

1、首先去官网下载mysql安装包&#xff0c;官网地址&#xff1a;MySQL :: Download MySQL Community Server 2&#xff1a;把安装包放到你安装mysql的地方&#xff0c;然后进行解压缩&#xff0c;注意&#xff0c;解压后的mysql没有配置文件&#xff0c;我们需要创建配置文件 配…

mediasoup webrtc音视频会议搭建

环境ubuntu22.10 nvm --version 0.33.11 node -v v16.20.2 npm -v 8.19.4 node-gyp -v v10.0.1 python3 --version Python 3.10.7 python with pip: sudo apt install python3-pip gcc&g version 12.2.0 (Ubuntu 12.2.0-3ubuntu1) Make 4.2.1 npm install mediasoup3 sudo …

S4.2.4.7 Start of Data Stream Ordered Set (SDS)

一 本章节主讲知识点 1.1 xxx 1.2 sss 1.3 ddd 二 本章节原文翻译 2.1 SDS 数据流开始有序集 SDS 代表传输的数据类型从有序集转为数据流。它会在 Configuration.Idle&#xff0c;Recovery.Idle 和 Tx 的 L0s.FTS 状态发送。Loopback 模式下&#xff0c;主机允许发送 SDS。…

初阶JavaEE(14)表白墙程序

接上次博客&#xff1a;初阶JavaEE&#xff08;13&#xff09;&#xff08;安装、配置&#xff1a;Smart Tomcat&#xff1b;访问出错怎么办&#xff1f;Servlet初识、调试、运行&#xff1b;HttpServlet&#xff1a;HttpServlet&#xff1b;HttpServletResponse&#xff09;-C…

Rust学习日记(二)变量的使用--结合--温度换算/斐波那契数列--实例

前言&#xff1a; 这是一个系列的学习笔记&#xff0c;会将笔者学习Rust语言的心得记录。 当然&#xff0c;这并非是流水账似的记录&#xff0c;而是结合实际程序项目的记录&#xff0c;如果你也对Rust感兴趣&#xff0c;那么我们可以一起交流探讨&#xff0c;使用Rust来构建程…

修复dinput8.dll文件的缺失,以及修复dinput8.dll文件时需要注意什么

dinput8.dll文件通常在使用大型游戏时容易出现dinput8.dll文件丢失的情况&#xff0c;今天这篇文章将要教大家修复dinput8.dll文件的缺失&#xff0c;同时在修复dinput8.dll文件时需要注意些什么&#xff1f;防止文件在修复的过程中出现其他的错误。 dinput8.dll是DirectInput库…

HarmonyOS列表组件

List组件的使用 import router from ohos.routerEntry Component struct Index {private arr: number[] [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]build() {Row() {Column() {List({ space: 10 }) {ForEach(this.arr, (item: number) > {ListItem() {Text(${item}).width(100%).heig…

解决Nsight Systems错误

一、错误1 解决办法 In order to collect CPU samples, Nsight Systems uses the linux perf functionality under the covers. This functionality is not available when Paranoid is set >2. (from the documentation) Requirements for x86_64, Power, and ARM SBSA T…

SQL Server2000mdf升级SQL Server2005数据库还原

SQL Server2000数据库还原sqlserver 2000mdf升级 sqlserver 2008数据库还原SQL Server2005数据库脚本 sqlserver数据库低版本升级成高版本 sqlserver数据库版本升级 数据库版本还原 如果本机安装了sqlserver2012或者sqlserver2019等高版本 怎么样才能运行sqlserver2000的数据库…

Make.com实现多个APP应用的自动化的入门指南

Make.com是一款基于云的自动化平台&#xff0c;可帮助用户将多个应用程序连接在一起&#xff0c;并通过设置自动化流程来简化日常任务。Make.com提供丰富的API集成&#xff0c;支持连接各种流行的应用程序&#xff0c;包括社交媒体、电子商务、CRM等。 使用Make.com实现多个AP…

基于8086家具门安全控制系统设计

**单片机设计介绍&#xff0c;基于8086家具门安全控制系统设计 文章目录 一 概要二、功能设计设计思路 三、 软件设计原理图 五、 程序六、 文章目录 一 概要 # 8086家具门安全控制系统设计介绍 8086家具门安全控制系统是一种用于保护家具和保证室内安全的系统。该系统基于808…

小程序如何实现下拉刷新

要在小程序中实现下拉刷新功能&#xff0c;您可以使用小程序提供的页面生命周期函数和相关 API 来实现。下面是一般的步骤&#xff1a; 在页面的 JSON 配置文件中开启下拉刷新 {"enablePullDownRefresh": true }在对应页面的 JavaScript 文件中&#xff0c;监听下拉…