zoukankan      html  css  js  c++  java
  • nginx-gridfs的安装

    mongodb中gridfs适合存放视频和高清图片等等超大文件(小的文件建议不要存在mongodb中);

    下面是在centos下配置nginx来訪问mongodb中的mp4文件:


    1:安装nginx-gridfs

    git clone https://github.com/rjhunjhunwla/nginx-gridfs //假设不存在git:yum -y install git
    cd nginx-gridfs/
    git submodule init
    git submodule update


    2::安装nginx

    yum -y install pcre-devel

     yum -y install zlib-devel

    ./configure --prefix=/opt/nginx --add-module=/opt/software/nginx-gridfs
    make
    make install


    3:配置nginx-gridfs:(參考:https://github.com/rjhunjhunwla/nginx-gridfs 相关的參数设置)

    在nginx.conf文件里增加:

    location /video {
                gridfs dbname
                   root_collection=fs
                   field=filename
                   type=string
                   user=username
                   pass=passwd;
                mongo 127.0.0.1:27017;
            }

    4:html中调用显示:(http://www.videojs.com/ 下载使用video.js)

    <video class="video-js vjs-default-skin" controls width="640" height="264" preload="auto">
      <source src="http://127.0.0.1/video/filename.mp4" type='video/mp4' />
     </video>

查看全文
  • 相关阅读:
    用c#开发微信(2)扫描二维码,用户授权后获取用户基本信息 (源码下载)
    3分钟上手log4net
    sql server 小技巧(8) visual studio 2013里使用Sql server compact 4.0及发布问题处理
    用c#开发微信(1)服务号的服务器配置和企业号的回调模式
    Dynamic CRM 2015学习笔记(6)没有足够的权限
    STL
    表格视图
    表格视图
    STL
    Python编程-Office操作-操作Excel(中)
  • 原文地址:https://www.cnblogs.com/ldxsuanfa/p/10565588.html
  • Copyright © 2011-2022 走看看