Installation and use of Gridfs-nginx

Source: Internet
Author: User
Tags using git

When using Gridfs's Nginx module, make sure your machine is already installed MONGO

Start by using git to download the latest Gridfs Nginx module to the local

git clone https://cd nginx-gridfs/git submodule initgit submodule update

In most cases we are already installed Nginx, now we need to recompile the Nginx, add the new module

First look at the current Nginx installation parameters,

./nginx/sbin/nginx-V// will output the following information nginx version:nginx/1.0.  -  gcc4.4. 7 20120313 4.4. 7---prefix=/webser/nginx--with-pcre=/webser/lamp/pcre-8.30 -- Group=www--user=www--with-http_stub_status_module--with-openssl=--with-http_ssl_module

Find the source package of the previous Nginx installation, re-edit

>./configure--prefix=/opt/nginx [Copy the previous configuration, then add the new module]--add-module=/opt/software/nginx-gridfs[ This directory is the folder that you just synced to local with git]// completed should be // to note that the previous configuration to the Pcre source path is also correct >./ Configure---prefix=/webser/nginx--with-pcre=/webser/lamp/pcre-8.30> make

Because we are not reinstalling, do not install when make is finished

Delete or rename the/webser/nginx/sbin/nginx file before the source package./nginx-1.0.14/objs/nginx Copy the past directly, then execute the command

./nginx/sbin/nginx-v you can see that the new module has been added, and the configuration file can be modified to use the Gridfs-nginx module .

added in the nginx.conf file: location/image/ {                    //Default_type image/png;//default MIME type can be specifiedGridfs dbname//Database nameRoot_collection=test//Collection name (table name)field=_id//access to "filename,_id" through whatType=objectid//Name Type String,int,objectidUser=Root Pass=123456; MONGO127.0.0.1:27017; }

Installation and use of Gridfs-nginx

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.