手机版
你好,游客 登录 注册
背景:
阅读新闻

Nginx视频点播安装配置

[日期:2014-03-24] 来源:Linux社区  作者:Linux [字体:大 中 小]

创建用户 useradd www

安装linux批量部署
yum groupinstall -y "Development Tools" "Development Libraries"

安装zlib  nginx运行需要的函数库安装openssh 支持安全通信
yum install zlib* openssl* -y安装与perl兼容的正则表达式库模块tar fvxz pcre-8.33.tar.gz./configure makemake install安装libunwind库tar zxf libunwind-1.1.tar.gz cd libunwind-1.1CFLAGS=-fPIC ./configuremake CFLAGS=-fPICmake CFLAGS=-fPIC installecho '/usr/local/lib' > /etc/ld.so.conf.d/usr_local_lib.confldconfig安装gperftools CPU分析器tar zxf gperftools-2.1.tar.gz cd gperftools-2.1./configure makemake installldconfig
 安装伪流模块
tar zxf nginx_mod_h264_streaming-2.2.7.tar.gz注释 nginx_mod_h264_streaming-2.2.7/src/ngx_http_streaming_module.c 158行的if代码

下载nginx视频模块

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

nginx-rtmp-module

安装nginx-1.5.1

tar fvxz nginx-1.5.1.tar.gz

cd nginx-1.5.1

编译

./configure --prefix=/usr/local/nginx --with-http_stub_status_module  --with-http_gzip_static_module--with-http_ssl_module --with-zlib=/zkx/zlib-1.2.3 --with-pcre=/zkx/pcre-8.33--user=www --group=www --with-http_sub_module --with-http_flv_module--add-module=/zkx/nginx_mod_h264_streaming-2.2.7 --with-http_dav_module--with-http_addition_module --add-module=/zkx/nginx-accesskey-2.0.3--add-module=/zkx/nginx-rtmp-module/

make && make install

将视频和html页面放到指定路径下

/usr/local/nginx/vod/flvs


打开nginx配置文件进行配置

vi /usr/local/nginx/conf/nginx.conf

配置server段

 server {

      listen      80;

      server_name  localhost;

 


      #charset koi8-r;

 


      #access_log logs/host.access.log  main;

 


      location ~* \.(gif|jpg|jpeg|png|bmp|swf|ico|html|js|as)$ {

          root  /usr/local/nginx/vod/flvs;

      #    index  index.html index.htm;

    expires 30d;

 }

 


      location ~* \.(flv|mp4)$ {

        root /usr/local/nginx/vod/flvs;

        expires 1h;

      }

Nginx 的详细介绍:请点这里
Nginx 的下载地址:请点这里

相关阅读:

CentOS 6.2实战部署Nginx+MySQL+PHP http://www.linuxidc.com/Linux/2013-09/90020.htm

使用Nginx搭建WEB服务器 http://www.linuxidc.com/Linux/2013-09/89768.htm

搭建基于Linux6.3+Nginx1.2+PHP5+MySQL5.5的Web服务器全过程 http://www.linuxidc.com/Linux/2013-09/89692.htm

CentOS 6.3下Nginx性能调优 http://www.linuxidc.com/Linux/2013-09/89656.htm

CentOS 6.3下配置Nginx加载ngx_pagespeed模块 http://www.linuxidc.com/Linux/2013-09/89657.htm

CentOS 6.4安装配置Nginx+Pcre+php-fpm http://www.linuxidc.com/Linux/2013-08/88984.htm

Nginx搭建视频点播服务器(仿真专业流媒体软件) http://www.linuxidc.com/Linux/2012-08/69151.htm

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款