nginx、apache配置flv流媒体拖动,nginxflv


nginx下配置flv拖动

首先,下载nginx源码包,以0.8.54版本为例


wget  http://nginx.org/download/nginx-0.8.54.tar.gz

重编译之前,停掉nginx服务。查看一下nginx原来的编译参数


/usr/local/nginx/sbin/nginx  –V

在原来的参数基础上添加flv的支持


--with-http_flv_module

0.8.54版本为例,进行编译


./configure --user=www --group=www  --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module  --with-http_gzip_static_module --with-ipv6 --with-http_flv_module

make  && make install

编译完成后,在nginx.conf文件里添加flv支持

  location ~ \.flv$  {

flv;

}

启动nginx,使用curl –I 来查看是否成功。

主要查看的是 Content-Length的数值。和加上参数start 之后进行对比。

例如:


curl -I  http://video.zhangyuc.com/flv/110718/video.flv

Content-Length: 1218888

对比


curl -I  http://video.zhangyuc.com/flv/110718/video.flv?<strong>start=12345</strong>

Content-Length: 1206556

以上示例只列出Content-Length的值。

假如加上参数之后,Content-Length值依旧和之前相同,则表示配置没有成功

 

apache下配置flv拖动

Windows服务器下配置拖动,一共需要两步

第一步,下载mod_flvx.so并放到apache目录下的modules文件夹下

下载地址:


http://www.mosalov.com/files/mod_flvx.so

第二步,在apache的配置文件中,添加以下内容,重启apache服务


LoadModule  flvx_module  modules/mod_flvx.so

AddHandler flv-stream .flv

 

linux服务器下配置拖动,需要下载mod_flvx.c文件后进行编译

第一步,下载mod_flvx.c,并进行编译。


wget  https://github.com/osantana/mod_flvx/blob/master/mod_flvx.c

使用apxs进行编译,编译前,请检查apxs版本


apxs -c -i  ./mod_flvx.c

第二步,在apache的conf.d目录下创建mod_flvx.conf文件,并写入以下内容


LoadModule flvx_module  /usr/lib/apache2/modules/mod_flvx.so
AddHandler flv-stream  .flv

配置完成后重启即可

相关内容

    暂无相关文章