Nginx加载新的模块,编译报错记录
参考: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加载新的模块,编译报错记录的更多相关文章
- nginx加载字体文件的时候报错
nginx 下加载配置 location ~* \.(eot|ttf|ttc|otf|eot|woff|woff2|svg)$ { root /web/static_jr ...
- nginx添加nginx_mod_h264_streaming-2.2.7模块编译报错
报错ngx_http_streaming_module.c:158: 错误:‘ngx_http_request_t’ 没有名为 ‘zero_in_uri’ 的成员.这需要修改nginx_mod_h26 ...
- ios 12 xcode10 新升级的编译报错libstdc++.6.0.9 Multiple commands produce
问题一 编译报错 Showing Recent Messages :-1: Multiple commands produce '/Users/duning/Library/Developer/Xco ...
- 用eclipse加载别人的工程,报错Target runtime com.genuitec.runtime.generic.jee60 is not defined
系统加载工程后,报错Target runtime com.genuitec.runtime.generic.jee60 is not defined,在发布工程的同事电脑上正常 新导入的工程,出问题很 ...
- antd按需加载,配置babel-plugin-import插件,编译后报错.bezierEasingMixin()解决方案
报错如下: ./node_modules/antd/lib/button/style/index.less (./node_modules/css-loader??ref--6-oneOf-7-1!. ...
- 微信小程序---分包加载(subpackages)及报错
某些情况下,开发者需要将小程序划分成不同的子包,在构建时打包成不同的分包,用户在使用时按需进行加载. 分包很简单,具体步骤如下: 在app.json中,创建subPackages,root表示分包A的 ...
- jfinal不能正确加载html网页,总是报错的解决方法
今天自学jfinal,遇到一个很奇怪的问题,render("/index.html");总是报错. 仔细看错误日志,才发现原来是因为html网页放到了WEB-INF文件夹下面了,所 ...
- 记录一次win2003服务器的IIS服务加载.flv后缀的资源报错404的处理方法
问题:访问某个域名下的xxxx.flv资源,页面报错404. 解决思路: 1.权限是否给足 user权限给完全控制咯 如果你访问该域名下的其他资源无问题的话就不是介个原因了 2.MIME类型是否少了 ...
- vue加载单文件使用vue-loader报错
报错信息如下:ERROR in ./src/login.vue Module Error (from ./node_modules/vue-loader/lib/index.js): vue-load ...
随机推荐
- 由于vue的for循环id并不严谨,提高id严谨性
如果后台没有传入id,我们拿到的数据没有id修改等操作不方便,如何拿到id呢 https://github.com/dylang/shortid 提供唯一id 插件的引入和使用: <templa ...
- CSS Web Fonts 网络字体
Fonts 1. CSS font-family 在 CSS 中,可以使用 font-family 属性来指定字体,浏览器渲染文字时候会根据这个属性应用于元素.如果没有指定这个属性或者指定的字体不存在 ...
- Codeforces 193D - Two Segments(线段树)
Codeforces 题目传送门 & 洛谷题目传送门 感觉这个 *2900 并不难啊,为什么我没想出来呢 awa 顺便膜拜 ycx 一眼秒掉此题 %%% 首先碰到这类题有两种思路,一是枚举两个 ...
- P5896 [IOI2016]aliens
*IX. P5896 [IOI2016]aliens DP 优化方法大杂烩,详解 wqs 二分及其注意事项,斜率优化等其它 DP 优化方法. **** 团队赛 T6,没想到是 IOI 原题.当时看出来 ...
- Glib 对 C 函数进行单元测试
1. Glib 单元测试框架 Glib 为单元测试提供了一套完整的测试框架,每个测试运行包括以下几个部分 测试数据结构 测试 setup 与 teardown 函数 测试函数 2. 单元测试数据结构 ...
- [Ocean Modelling for Begineers] Ch3. Basics of Geophysical Fluid Dynamics
Ch3. Basics of Geophysical Fluid Dynamics 本章主要介绍 标量与向量 Newton定律 波动与恒定状态流体 浮力 科氏力 守恒律 紊动 N-S方程 3.1 Un ...
- 2基因组间鉴定SV
本文学习费章军老师文章Genome of Solanum pimpinellifolium provides insights into structural variants during toma ...
- Web网页服务器软件——介绍
Web网页服务器软件与硬件服务器的关系,就像软件和电脑的关系. 目前有,世界使用排列第一名的Apache.还有可以在Linux系统下快速方便地搭建出LNMP Web服务环境的Nginx(其中LNMP分 ...
- TCP三次握手与Linux的TCP内核参数优化
感谢各位技术大佬的资料分享,这里我把我理解的内容做一个整理 一:TCP的三次握手 1.TCP简述 TCP是一个面向连接的协议,在连接双方发送数据之前,首先需要建立一条连接.TCP建立连接可以简单称为: ...
- 移动测试(web和app)及app测试实战
移动测试androidiosapp上 原生GUI 混合应用H5 web端兼容性浏览器测试需要的内容:safari 浏览器edge浏览器ie11浏览器firefox浏览器chrome浏览器 国内360浏 ...