Nginx Recompile install upload module

Source: Internet
Author: User

Due to PHP processing upload will be timed out, and display the upload Progress official PHP does not support nginx+php, so decided to let Nginx handle the upload themselves, My local environment is already installed on Mac nginx1.8.0, installation mode for brew, so need to recompile nginx add upload module.

Nginx:http://nginx.org/en/download.html

nginx-upload-module:https://github.com/vkholodkov/nginx-upload-module/tree/2.2

Decompression Nginx

Tar xvzf nginx-1.8.0.tar.gz

Nginx-upload-module Extract Directory:/usr/local/nginx-upload-module-2.2

Since the upload module does not update with Nginx new version, so some places need to modify, download patch file, Address: http://paste.davromaniak.eu/index.php?show=110

Download file name Davromaniak.txt, put into/usr/local/nginx-upload-module-2.2 directory, execute patch

CP darvromaniak.txt/usr/local/nginx-upload-module-2.2  patch Ngx_http_upload_module

After execution, start compiling nginx

Nginx-v View the installed Nginx version and compile parameters (this is my nginx parameter)

Nginx version:nginx/1.8.0built by Clang6.0 (clang-600.0.57) (based on LLVM 3.5svn) built with OpenSSL1.0.2A Mar 2015TLS SNI Support enabledconfigure arguments:--prefix=/usr/local/cellar/nginx/1.8.0--with-http_ssl_module--with-pcre--with-ipv6--sbin-path=/usr/local/ Cellar/nginx/1.8.0/bin/nginx--with-cc-opt= '-i/usr/local/cellar/pcre/8.36/include-i/usr/local/cellar/openssl/ 1.0.2a-1/include '--with-ld-opt= '-l/usr/local/cellar/pcre/8.36/lib-l/usr/local/cellar/openssl/1.0.2a-1/lib '-- Conf-path=/usr/local/etc/nginx/nginx.conf--pid-path=/usr/local/var/run/nginx.pid--lock-path=/usr/local/var/run/nginx.lock--http-client-body-temp-path=/usr/local/var/run/nginx/client_body_temp--http-proxy-temp-path=/usr/local/var/run/nginx/proxy_temp--http-fastcgi-temp-path=/usr/local/var/run/nginx/fastcgi_temp--http-uwsgi-temp-path=/usr/local/var/run/nginx/uwsgi_temp--http-scgi-temp-path=/usr/local/var/run/nginx/scgi_temp--http-Log-path=/usr/local/var/Log/nginx/access.Log--error-Log-path=/usr/local/var/Log/nginx/error.Log--with-http_gzip_static_module

CD nginx-1.8.0

Add--add-module=/usr/local/nginx-upload-module-2.2 (nginx-upload-module extract directory) parameter recompile:

  

./configure--prefix=/usr/local/cellar/nginx/1.8.0--with-http_ssl_module--with-pcre--with-ipv6--sbin-path=/usr/ Local/cellar/nginx/1.8.0/bin/nginx--with-cc-opt= '-i/usr/local/cellar/pcre/8.36/include-i/usr/local/cellar/ Openssl/1.0.2a-1/include '--with-ld-opt= '-l/usr/local/cellar/pcre/8.36/lib-l/usr/local/cellar/openssl/1.0.2a-1/ Lib '--conf-path=/usr/local/etc/nginx/nginx.conf--pid-path=/usr/local/var/run/nginx.pid--lock-path=/usr/local/var/run/nginx.lock--http-client-body-temp-path=/usr/local/var/run/nginx/client_body_temp--http-proxy-temp-path=/usr/local/var/run/nginx/proxy_temp--http-fastcgi-temp-path=/usr/local/var/run/nginx/fastcgi_temp--http-uwsgi-temp-path=/usr/local/var/run/nginx/uwsgi_temp--http-scgi-temp-path=/usr/local/var/run/nginx/scgi_temp--http-Log-path=/usr/local/var/Log/nginx/access.Log--error-Log-path=/usr/local/var/Log/nginx/error.Log--with-http_gzip_static_module--add-module=/usr/local/nginx-upload-module-2.2

Backup Old Nginx after successful compilation

Cp/usr/local/cellar/nginx/1.8.0/bin/nginx/usr/local/cellar/nginx/1.8.0/bin/nginx.bak

Overwrite the new Nginx program with the old
Cp/usr/local/nginx-1.8.0/objs/nginx/usr/local/cellar/nginx/1.8.0/bin/nginx

  

Nginx Recompile install upload module

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.