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>

查看全文
  • 相关阅读:
    东方财富炒股公式
    centos8安装MySQL8——通过yum
    官网下载工具时。各种不同后缀名称的区别。
    线上不停机部署mysql主从
    店员任务项目总结
    JS到PHP使用RSA算法进行加密通讯
    无锁同步-JAVA之Volatile、Atomic和CAS
    无锁同步-C++11之Atomic和CAS
    浅谈一个网页打开的全过程(涉及DNS、CDN、Nginx负载均衡等)
    SQLServer数据库卡,内存吃不上去,系统资源用不上
  • 原文地址:https://www.cnblogs.com/ldxsuanfa/p/10565588.html
  • Copyright © 2011-2022 走看看