参考:https://www.cnblogs.com/Leechg/p/9969000.html

---------如下我的操作记录---------------

nginx -V查看当前nginx信息:

包括版本号和configure编译配置信息

nginx -V
nginx version: nginx/1.12.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_auth_request_module --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-google_perftools_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --with-ld-opt='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E'
下载相同版本号的nginx源码 http://nginx.org/en/download.html 并解压
wget http://nginx.org/download/nginx-1.12.2.tar.gz

下载要加载的新的模块,本例为nginx-rtmp-module nginx实现直播服务的模块

git clone https://github.com/arut/nginx-rtmp-module.git

目录结构如下:

[root@zmdsdkhost rtmp]# ls
nginx-1.12.2 nginx-1.12.2.tar.gz nginx-rtmp-module

./configure 配置编译选项,在原有编译选项上增加--add-module=../nginx-rtmp-module-1.2.1

./configure  --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_auth_request_module --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-google_perftools_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --with-ld-opt='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E' --add-module=../nginx-rtmp-module

make  记住不要install !!!!!!!!!!!!!!!!!!!!!!!!!

编译后的nginx在当前目录的objs文件夹内。

ls objs/
addon ngx_http_geoip_module_modules.c ngx_http_perl_module_modules.o ngx_mail_module.so
autoconf.err ngx_http_geoip_module_modules.o ngx_http_perl_module.so ngx_modules.c
Makefile ngx_http_geoip_module.so ngx_http_xslt_filter_module_modules.c ngx_modules.o
nginx ngx_http_image_filter_module_modules.c ngx_http_xslt_filter_module_modules.o ngx_stream_module_modules.c
nginx.8 ngx_http_image_filter_module_modules.o ngx_http_xslt_filter_module.so ngx_stream_module_modules.o
ngx_auto_config.h ngx_http_image_filter_module.so ngx_mail_module_modules.c ngx_stream_module.so
ngx_auto_headers.h ngx_http_perl_module_modules.c ngx_mail_module_modules.o src

ls objs/

对已有nginx可执行文件进行替换

(base) [root@zmdsdkhost nginx-1.12.2]# which  nginx
/usr/sbin/nginx
(base) [root@zmdsdkhost nginx-1.12.2]# cd /usr/sbin/
(base) [root@zmdsdkhost sbin]# cp nginx{,.bak}
(base) [root@zmdsdkhost sbin]# cp /opt/rtmp/nginx-1.12.2/objs/nginx
nginx nginx.8
(base) [root@zmdsdkhost sbin]# cp /opt/rtmp/nginx-1.12.2/objs/nginx .
cp: overwrite ‘./nginx’? y
(base) [root@zmdsdkhost sbin]# ls nginx*
nginx nginx.bak

 

======问题记录=======

错误./configure: error: the HTTP rewrite module requires the PCRE library.

解决:安装pcre-devel:yum -y install pcre-devel

错误:./configure: error: the HTTP cache module requires md5 functions

from OpenSSL library. You can either disable the module by using 
–without-http-cache option, or install the OpenSSL library into the system, 
or build the OpenSSL library statically from the source with nginx by using 
–with-http_ssl_module –with-openssl= options.

解决:yum -y install openssl openssl-devel

错误:./configure: error: the HTTP XSLT module requires the libxml2/libxslt    缺少libxml2

解决:yum -y install libxml2 libxml2-devel && yum -y install libxslt-devel

错误信息:./configure: error: the HTTP image filter module requires the GD library. You can either do not enable the module or install the libraries.

解决方法:http_image_filter_module是nginx提供的集成图片处理模块,需要gd-devel的支持   yum -y install gd-devel

错误信息:./configure: error: perl module ExtUtils::Embed is required 缺少ExtUtils

解决方法:yum -y install perl-devel perl-ExtUtils-Embed

错误信息:./configure: error: the GeoIP module requires the GeoIP library. You can either do not enable the module or install the library. 缺少GeoIP

解决方法:yum -y install GeoIP GeoIP-devel GeoIP-data

错误信息:./configure: error: the Google perftools module requires the Google perftools
library. You can either do not enable the module or install the library.

解决方法:yum -y install gperftools

 

Nginx加载新的模块,编译报错记录的更多相关文章

  1. nginx加载字体文件的时候报错

    nginx 下加载配置 location ~* \.(eot|ttf|ttc|otf|eot|woff|woff2|svg)$ {                root /web/static_jr ...

  2. nginx添加nginx_mod_h264_streaming-2.2.7模块编译报错

    报错ngx_http_streaming_module.c:158: 错误:‘ngx_http_request_t’ 没有名为 ‘zero_in_uri’ 的成员.这需要修改nginx_mod_h26 ...

  3. ios 12 xcode10 新升级的编译报错libstdc++.6.0.9 Multiple commands produce

    问题一 编译报错 Showing Recent Messages :-1: Multiple commands produce '/Users/duning/Library/Developer/Xco ...

  4. 用eclipse加载别人的工程,报错Target runtime com.genuitec.runtime.generic.jee60 is not defined

    系统加载工程后,报错Target runtime com.genuitec.runtime.generic.jee60 is not defined,在发布工程的同事电脑上正常 新导入的工程,出问题很 ...

  5. antd按需加载,配置babel-plugin-import插件,编译后报错.bezierEasingMixin()解决方案

    报错如下: ./node_modules/antd/lib/button/style/index.less (./node_modules/css-loader??ref--6-oneOf-7-1!. ...

  6. 微信小程序---分包加载(subpackages)及报错

    某些情况下,开发者需要将小程序划分成不同的子包,在构建时打包成不同的分包,用户在使用时按需进行加载. 分包很简单,具体步骤如下: 在app.json中,创建subPackages,root表示分包A的 ...

  7. jfinal不能正确加载html网页,总是报错的解决方法

    今天自学jfinal,遇到一个很奇怪的问题,render("/index.html");总是报错. 仔细看错误日志,才发现原来是因为html网页放到了WEB-INF文件夹下面了,所 ...

  8. 记录一次win2003服务器的IIS服务加载.flv后缀的资源报错404的处理方法

    问题:访问某个域名下的xxxx.flv资源,页面报错404. 解决思路: 1.权限是否给足 user权限给完全控制咯 如果你访问该域名下的其他资源无问题的话就不是介个原因了 2.MIME类型是否少了 ...

  9. vue加载单文件使用vue-loader报错

    报错信息如下:ERROR in ./src/login.vue Module Error (from ./node_modules/vue-loader/lib/index.js): vue-load ...

随机推荐

  1. mybatis新增账号并且返回主键id

    <!--新增账号和权限的关联关系--><insert id="save" useGeneratedKeys="true" keyPropert ...

  2. Kruskal 重构树小记

    其实也不是多难的知识点吧--学了一个中午+半个下午就把它学会了(做过那道 jxd 作业 CF571D 的应该比较好理解) Kruskal 重构树大概就是在正常 Kruskal 的时候,对于两个需要连边 ...

  3. C++匿名函数的使用

    c++匿名函数使用方法 1.匿名函数的使用 匿名函数的基本语法为: //[捕获列表](参数列表)->返回类型{函数体} int main() { auto Add = [](int a, int ...

  4. Linux图片查看软件ImageMagick安装

    在Linux中查看图片,这个需求是非常常见的.总不至于在集群中生成个图片,随便看下效果,也要用filezilla.winscp之类的远程文件传输工具导过来导过去吧,这样效率太低. Linux图片查看常 ...

  5. 【Python小试】去除核酸特定长度的接头序列

    输入 input.txt ATTCGATTATAAGCTCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATC ATTCGATTATAAGCACTGATCGATCGATCG ...

  6. perl substr

    substr EXPR,OFFSET,LENGTH,REPLACEMENT substr EXPR,OFFSET,LENGTH substr EXPR,OFFSET Extracts a substr ...

  7. js变量作为数组对象的键值方法

    js变量作为数组对象的键值方法,变量键值获取数组值 js也可以像php的数组一样用下标获取数组的值,方法是: var arr = {'key':'abc'}; var key = 'key'; con ...

  8. A Child's History of England.30

    CHAPTER 10 ENGLAND UNDER HENRY THE FIRST, CALLED FINE-SCHOLAR Fine-scholar, on hearing of the Red Ki ...

  9. 大数据学习day15----第三阶段----scala03--------1.函数(“_”的使用, 函数和方法的区别)2. 数组和集合常用的方法(迭代器,并行集合) 3. 深度理解函数 4 练习(用java实现类似Scala函数式编程的功能(不能使用Lambda表达式))

    1. 函数 函数就是一个非常灵活的运算逻辑,可以灵活的将函数传入方法中,前提是方法中接收的是类型一致的函数类型 函数式编程的好处:想要做什么就调用相应的方法(fliter.map.groupBy.so ...

  10. TLSv1.3 Support:主流 Web 客户端和服务端对 TLSv1.3 的支持情况

    TLSv1.3 Support:主流 Web 客户端和服务端对 TLSv1.3 的支持情况 请访问原文链接:https://sysin.org/blog/tlsv1-3-support/,查看最新版. ...