Nginx supports MongoDB's compilation installation and configuration

Source: Internet
Author: User
Tags install openssl git clone

Nginx Support MongoDB need to add modules to compile the installation, the steps are as follows:
    • Installing pcre-devel
      sudo apt-get install libpcre3 Libpcre3-dev
      sudo apt-get install OpenSSL Libssl-dev

    • Installing Nginx-gridfs
      git clone git://github.com/mdirolf/nginx-gridfs.git
      CD nginx-gridfs/
      Git submodule init


      git submodule update


      cd/data/soft/nginx-1.6.2 (here is the download good nginx source directory)


      ./configure--add-module=/data/soft/nginx-gridfs (here is the Gridfs directory for git download above)


      Make
      Make install

    • Modify the Nginx conf file

  1. server {

  2. Listen ;

  3. server_name s1.111du.com;

  4. //All requests are mapped to MongoDB's service

  5. Location/{

  6. //through field=filename to do data query

  7. Gridfs Imark field=filename type=string;

  8. //mongodb's Services

  9. MONGO 127.0. 0.1:30001;

  10. }

  11. # REDIRECT Server error pages to the static page/50x.html

  12. #

  13. Error_page 502 503 504 /50x.html;

  14. Location =/50x.html {

  15. root HTML;

  16. }

  17. # Deny access to. htaccess files, if Apache ' s document Root

  18. # concurs with Nginx ' s one

  19. #

  20. Location ~/web-inf/{

  21. Deny all;

  22. }

  23. }

This article is from the "I Love CTO" blog, please be sure to keep this source http://tanjunjie.blog.51cto.com/6988/1579626

Nginx supports MongoDB's compilation installation and configuration

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.