博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
nginx centos下安装遇到的问题总结
阅读量:4160 次
发布时间:2019-05-26

本文共 3220 字,大约阅读时间需要 10 分钟。

1. 1, 编译环境搭建。
sudo apt-get install g++
sudo apt-get -y install autoconf automake build-essential libass-dev libgpac-dev libsdl1.2-dev libtheora-dev libtool libvdpau-dev libvorbis-dev libx11-dev libxext-dev libxfixes-dev pkg-config texi2html zlib1g-dev libssl-dev
2.下载安装相关库
(1) pcre-8.32
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
tar -zxvf pcre-8.32.tar.gz
cd pcre-8.32
./configure
make
make install
(2)zlib 为了gzip压缩
http://zlib.net/zlib-1.2.8.tar.gz
tar -zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make
make install
(3)
http://www.openssl.org/source/openssl-1.0.1f.tar.gz
tar -zxvf openssl-1.0.1f.tar.gz
./config
make
make install
在安装时如果出现如下错误:POD document had syntax errors at /usr/bin/pod2man line 69. make .那么,解决如下:
rm /usr/bin/pod2man
(4)nginx_mod_h264_streaming-2.2.7
http://h264.code-shop.com/download/nginx_mod_h264_streaming-2.2.7.tar.gz
tar -zxvf nginx_mod_h264_streaming-2.2.7.tar.gz
(5)nginx-rtmp-module
https://github.com/arut/nginx-rtmp-module
unzip nginx-rtmp-module-master
(6)
http://nginx.org/download/nginx-1.5.9.tar.gz
tar -zxvf nginx-1.5.9.tar.gz
./configure \
--prefix=/usr/local/nginx/ \
--add-module=../nginx-rtmp-module-1.0.2 \
--with-http_ssl_module \
--add-module=../nginx_mod_h264_streaming-2.2.7 \
--with-pcre=../pcre-8.32 \
--with-zlib=../zlib-1.2.8  \
--with-http_flv_module \
--with-http_stub_status_module \
--with-http_mp4_module  
make
make install
可能遇到问题1
/root/nginx_mod_h264_streaming-2.2.7/src/ngx_http_streaming_module.c: In function ‘ngx_streaming_handler’:
/root/nginx_mod_h264_streaming-2.2.7/src/ngx_http_streaming_module.c:158: error: ‘ngx_http_request_t’ has no member named ‘zero_in_uri’
make[1]: *** [objs/addon/src/ngx_http_h264_streaming_module.o] Error 1
make[1]: Leaving directory `/root/nnginx-1.5.9'
make: *** [build] Error 2
那么将src/ngx_http_streaming_module.c文件中以下代码删除或者是注释掉就可以了:
/* TODO: Win32 */
if (r->zero_in_uri)
{
     return NGX_DECLINED;
}
可能遇到问题2
../nginx_mod_h264_streaming-2.2.7/src/mp4_reader.c: 在函数‘esds_read’中:
../nginx_mod_h264_streaming-2.2.7/src/mp4_reader.c:377:16: 错误: 变量‘stream_priority’被设定但未被使用 [-Werror=unused-but-set-variable]
../nginx_mod_h264_streaming-2.2.7/src/mp4_reader.c:376:12: 错误: 变量‘stream_id’被设定但未被使用 [-Werror=unused-but-set-variable]
../nginx_mod_h264_streaming-2.2.7/src/mp4_reader.c: 在函数‘stsd_parse_vide’中:
../nginx_mod_h264_streaming-2.2.7/src/mp4_reader.c:529:22: 错误: 变量‘level_indication’被设定但未被使用 [-Werror=unused-but-set-variable]
../nginx_mod_h264_streaming-2.2.7/src/mp4_reader.c:528:22: 错误: 变量‘profile_compatibility’被设定但未被使用 [-Werror=unused-but-set-variable]
../nginx_mod_h264_streaming-2.2.7/src/mp4_reader.c:527:22: 错误: 变量‘profile_indication’被设定但未被使用 [-Werror=unused-but-set-variable]
../nginx_mod_h264_streaming-2.2.7/src/mp4_reader.c:526:22: 错误: 变量‘configuration_version’被设定但未被使用 [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
make[1]: *** [objs/addon/src/mp4_reader.o] 错误 1
解决方法:
# vim objs/Makefile (修改objs/Makefile文件, 去掉其中的"-Werror"), 然后就能够正常编译了.
(7) 然后 cd /usr/local/nginx
启动  ./nginx
优雅关闭   ./nginx -s quit
快速关闭   ./nginx -s stop
nginx -s reload  :修改配置后重新加载生效
nginx -s reopen  :重新打开日志文件
nginx -t -c /path/to/nginx.conf 测试nginx配置文件是否正确
(8) 浏览器打开 localhost 就能看到欢迎的界面
命令行:lynx localhost

转载地址:http://scdxi.baihongyu.com/

你可能感兴趣的文章
ACM(Association for Computing Machinery )组织的详细介绍
查看>>
unix高级编程之-命令行参数(实践一)
查看>>
无线网络加密方式对比 .
查看>>
linux中cat命令使用详解
查看>>
Static 作用详述
查看>>
透析ICMP协议(三): 牛刀初试之一 应用篇ping(ICMP.dll)
查看>>
透析ICMP协议(四): 牛刀初试之二 应用篇ping(RAW Socket)
查看>>
再次写给我们这些浮躁的程序员
查看>>
Linux下重要日志文件及查看方式(1)
查看>>
Linux下重要日志文件及查看方式(2)
查看>>
Ubuntu系统root用户密码找回方法
查看>>
Linux驱动程序中比较重要的宏
查看>>
芯片驱动问题定位思路总结之一单板重启的问题
查看>>
S3C2440看门狗定时器
查看>>
LDD3源码分析之llseek分析
查看>>
linux read 用法
查看>>
LDD3源码分析之llseek分析(二)
查看>>
printk及控制台的日志级别
查看>>
Linux驱动加载实例
查看>>
详解数据库设计中的三大范式理论
查看>>