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>

查看全文
  • 相关阅读:
    NSString的几种常用方法
    ios页面间传递参数四种方式
    ios category类别的使用
    iOS: 枚举类型 enum,NS_ENUM,NS_OPTIONS
    IOS导航栏的使用方法
    报错:Expected one result (or null) to be returned by selectOne(), but found: 6
    Spring小知识
    spring动态代理
    登录和注册功能思路
    sql语句实例练习
  • 原文地址:https://www.cnblogs.com/ldxsuanfa/p/10565588.html
  • Copyright © 2011-2022 走看看