centos7服务安装_流媒体服务器_安装nginx
来源:互联网 发布:abb编程培训 编辑:程序博客网 时间:2024/06/05 12:06
转载于http://hdu104.com/294
3.安装配置Nginx
3.1)先安装各种依赖(nginx需要pcre支持,yamdi用来为flv创建关键帧才能随意拖动)
[root@AY130611215205Z ffmpeg-2.0.1]# yum install gcc gcc-c++ openssl-devel zlib-devel pcre pcre-devel yamdi
3.2)下载所需的nginx模块
第一个是nginx_mod_h264_streaming,让nginx支持flv/mp4流播放
[root@AY130611215205Z ~]# wget http://h264.code-shop.com/download/nginx_mod_h264_streaming-2.2.7.tar.gz
[root@AY130611215205Z ~]# tar zxvf nginx_mod_h264_streaming-2.2.7.tar.gz
注意:先要修改一下这家伙的源码,注释掉nginx_mod_h264_streaming-2.2.7/src/ngx_http_streaming_module.c的158到161行
/* TODO: Win32 */
//if (r->zero_in_uri)
// {
// return NGX_DECLINED;
// }
第二个是nginx-rtmp-module,让nginx支持rtmp/hls协议
[root@AY130611215205Z ~]# wget -O nginx-rtmp-module.zip https://github.com/arut/nginx-rtmp-module/archive/master.zip
[root@AY130611215205Z ~]# unzip nginx-rtmp-module.zip
下载清缓存的模块
[root@AY130611215205Z ~]# wget -O ngx_cache_purge.ziphttps://github.com/FRiCKLE/ngx_cache_purge/archive/master.zip
[root@AY130611215205Z ~]# unzip ngx_cache_purge.zip
3.3)下载安装nginx
[root@AY130611215205Z ~]# wget http://nginx.org/download/nginx-1.2.9.tar.gz
[root@AY130611215205Z ~]# tar zxvf nginx-1.2.9.tar.gz
[root@AY130611215205Z ~]# cd nginx-1.2.9
[root@AY130611215205Z nginx-1.2.9]# ./configure –user=daemon –group=daemon –prefix=/usr/local/nginx/ –add-module=../nginx-rtmp-module-master –add-module=../ngx_cache_purge-master –add-module=../nginx_mod_h264_streaming-2.2.7 –with-http_stub_status_module –with-http_ssl_module –with-http_sub_module –with-http_gzip_static_module –with-http_flv_module
[root@AY130611215205Z nginx-1.2.9]# make && make install
PS:若提示make[1]: *** [objs/addon/src/ngx_http_h264_streaming_module.o] Error 1,请参考3.3.2小节的注意点,然后重新运行./configure这一段
/**———以下是安装了Tengine后重新编译的代码,模块的路径自己对一下———**//
./configure --add-module=../nginx-rtmp-module-master --add-module=../ngx_cache_purge-master --add-module=../nginx_mod_h264_streaming-2.2.7 --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_gzip_static_module --with-http_flv_module
运行一下nginx
[root@AY130611215205Z ~]# /usr/local/nginx/sbin/nginx
然后用浏览器你的服务器IP,看到welcome就对了
或者到nginx的sbin目录下,运行一下nginx -V,看看列表出来的modules对不对
启动 ./nginx
优雅关闭 ./nginx -s quit
快速关闭 ./nginx -s stop
nginx -s reload :修改配置后重新加载生效
nginx -s reopen :重新打开日志文件
nginx -t -c /path/to/nginx.conf 测试nginx配置文件是否正确
- centos7服务安装_流媒体服务器_安装nginx
- centos7服务安装_流媒体服务器_安装nginx
- centos7服务安装_流媒体服务器_安装
- CentOS7.2共享文件夹_安装配置SAMBA服务器
- CentOS7下安装配置流媒体服务器Red5
- linux centos7 安装Nginx服务
- Centos7安装配置nginx服务器
- centos7服务安装_NginxWeb服务器
- 一步步安装nginx搭建流媒体服务器
- 一步步安装nginx搭建流媒体服务器
- 一步步安装nginx搭建流媒体服务器
- Centos7 Redis安装_第四节
- VM下Centos7安装nginx服务
- nginx安装nginx-rtmp-module视频流媒体播放服务器模块
- Linux-CentOS7 Red5流媒体服务器的安装与配置
- CentOS7下安装配置流媒体服务器FMS5.0
- centos7中Nginx服务器的安装教程
- CentOS7安装并配置nginx服务器
- android:clipChildren的意思及其用法
- DrawerLayout
- Django项目中创建前端Vue.js项目的步骤
- Java校招面试 Google面试官亲授
- 使用阿里ARouter路由实现模块化开发流程
- centos7服务安装_流媒体服务器_安装nginx
- C#串口上位机源代码
- FlexboxLayout选中之——单选/多选
- ubuntu16.04环境用pip3安装dlib
- struts2-hibernate 总结
- 171208之Oracle总结(二)
- 省选专练[HNOI2010]BOUNCE 弹飞绵羊
- Hello Createjs
- HDOJ1397 Goldbach's Conjecture(哥德巴赫猜想)