NGINX-GRIDFS Module installation and use

Source: Internet
Author: User
Tags install openssl php tutorial
Reference article: http://www.open-open.com/lib/view/open1330171884015.html

NGINX-GRIDFS Module installation and use

Project home: Https://github.com/mdirolf/nginx-gridfs

With Nginx-gridfs, you can directly use http to access Gridfs files in the.

1. Installation

Install various dependency packages: zlib ,Pcre , OpenSSL

In Ubuntu may be the following command:

sudo apt-get install Zlib1g-dev// seemssudo apt-get install Zlib-dev cannot be installed

sudo apt-get install libpcre3 Libpcre3-dev

sudo apt-get install OpenSSL Libssl-dev

Installation git (slightly)

Use git DownloadNginx-gridfs's Code:

git clone git://github.com/mdirolf/nginx-gridfs.git

CD Nginx-gridfs

Git submodule init

git submodule update

Download Nginx :

wget Http://nginx.org/download/nginx-1.0.12.zip

Tar zxvf nginx-1.0.12.zip

CD nginx-1.0.12

./configure--add-module= The path >

Make

sudo make install

If a compilation error occurs, the Configure when addedThe--with-cc-opt=-wno-error parameter.

2. Configuration Nginx

In Server in the configuration, add the following

location/pics/{

Gridfs Pics

Field=filename

type=string;

MONGO 127.0.0.1:27017;

}

The above configuration indicates:

Database is Pics , by file name filename to access the file, filename is of type string

Currently only supported through ID and the filename to access the file.

Start Nginx : /usr/local/nginx/sbin/nginx

Use Mongovue put a picture 001.jpg uploaded to Pics the database.

Open:/http Localhost/pics/001.jpg

If successful, you can see the picture displayed.

3. Nginx-gridfs Insufficient

does not implement HTTP for range support, which is the ability to continue the breakpoint and to download the Shard.


Above describes the installation and use of the Nginx-gridfs module, including aspects of the content, you want to be interested in PHP tutorial friends helpful.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.