nginx重新编译安装upload模块

  由于php处理上传会出现超时,并且显示上传进度官方php不支持nginx+php,所以决定让nginx自己处理上传,我本地环境是mac上已经安装过nginx1.8.0,安装方式为brew,所以需要重新编译nginx添加upload模块。

  nginx下载地址:http://nginx.org/en/download.html

    nginx-upload-module下载地址:https://github.com/vkholodkov/nginx-upload-module/tree/2.2

解压nginx

  tar xvzf nginx-1.8.0.tar.gz

  nginx-upload-module解压目录为:/usr/local/nginx-upload-module-2.2

  由于upload模块没有随着nginx的更新出新版本,所以有些地方需要修改,下载补丁文件,地址:http://paste.davromaniak.eu/index.php?show=110

  下载文件名为davromaniak.txt,放入/usr/local/nginx-upload-module-2.2目录,执行补丁

cp darvromaniak.txt /usr/local/nginx-upload-module-2.2
patch ngx_http_upload_module.c davromaniak.txt 

执行完毕后,开始编译nginx

  nginx -V查看已经安装的nginx的版本和编译参数(这是我的nginx参数)

nginx version: nginx/1.8.0
built by clang 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
built with OpenSSL 1.0.2a 19 Mar 2015
TLS SNI support enabled
configure 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-module=/usr/local/nginx-upload-module-2.2(nginx-upload-module解压目录)参数重新编译:

  

./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

  编译成功后备份旧nginx

  cp /usr/local/Cellar/nginx/1.8.0/bin/nginx  /usr/local/Cellar/nginx/1.8.0/bin/nginx.bak

把新的nginx程序覆盖旧的
     cp /usr/local/nginx-1.8.0/objs/nginx /usr/local/Cellar/nginx/1.8.0/bin/nginx

  

时间: 2024-11-05 22:48:31

nginx重新编译安装upload模块的相关文章

原已经安装好的nginx,现在需要添加一个未被编译安装的模块--echo-nginx-module-0.56

为了测试一个NGINX变量,将NGINX加了一个编译模板echo-nginx-module-0.56. 参照如下文件 1,先看以前NGINX有哪些东东. sbin/nginx -Vnginx version: nginx/1.6.0built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) TLS SNI support enabledconfigure arguments: --prefix=/XXXX/lnmp/nginx --user=ngin

Nginx编译安装Lua模块

Nginx编译安装Lua模块 一.安装Lua环境及相关库 官网网址:https://github.com/openresty/lua-nginx-module LuaJIT ` wget http://luajit.org/download/LuaJIT-2.0.2.tar.gz make install PREFIX=/usr/local/LuaJIT export LUAJIT_LIB=/usr/local/LuaJIT/lib export LUAJIT_INC=/usr/local/Lu

Nginx的编译安装

Nginx的编译安装 一.Nginx的特点 1.Nginx 专为性能优化而开发,性能是其最重要的考量,实现上非常注重效率 .它支持内核 Poll 模型,能经受高负载的考验,有报告表明能支持高达 50,000 个并发连接数. 2.Nginx 具有很高的稳定性,Nginx 采取了分阶段资源分配技术,使得它的 CPU 与内存占用率非常低. 3.Nginx 代码质量非常高,代码很规范,手法成熟,模块扩展也很容易. 4.Nginx 还可以实现无缓存的反向代理加速,简单的负载均衡和容错. 二.获取并编译Ng

nginx的编译安装 centos7

nginx的编译安装 yum install -y vim lrzsz tree screen psmisc lsof tcpdump wget ntpdate gcc gcc-c++ glibc glibc-devel pcre pcre-devel openssl openssl-devel systemd-devel net-tools iotop bc zip unzip zlib-devel bash-completion nfs-utils automake libxml2 libx

使用tengine DSO 来动态编译安装第三方模块(Lua

在使用nginx时,需要增加或者改动一个模块,都需要重新编译nginx文件.最近使用了tengine,它提供的DSO工具来动态加载模块.本例测试需要动态增加lua-nginx模块,记录一下安装过程. 1. 编译安装 luajit Lua 环境推荐使用成熟快速的 luajit. 1 2 3 4 5 cd /root/Download/ wget http://luajit.org/download/LuaJIT-2.0.4.tar.gz tar zxvf LuaJIT-2.0.4.tar.gz c

Centos6.3 PHP编译安装JSON模块报错解决

我在搭建监控系统时候出现JSON模块安装失败,PHP5.3  系统Centos6.3,安装json报错 ZVAL_DELREF 符号未知错误... # Warning: PHP Startup: Unable to load dynamic library '/home/json/json-1.2.1/modules/json.so' - /home/json/json-1.2.1/modules/json.so: undefined symbol: ZVAL_DELREF in Unknown

Nginx 的编译安装和URL地址重写

本文转自:http://www.178linux.com/14119#rd?sukey=ecafc0a7cc4a741b573a095a3eb78af6b4c9116b74d0bbc9844d8fc5e8b50b3fc807541ae53fd06c67ac4f4adaae6981 在此只是做个笔记给自己看的. Nginx专题: 从编译安装到URL重写 前言 环境介绍 Nginx介绍 编译安装Nginx 配置文件解释 main和event{}的配置 http{}的基本配置 配置Nginx 搭建一个

安装好的nginx如何查看已经安装模块和添加一个未被编译安装的模块

今天想通过zabbix实现一个nginx监控,发现以来的模块–with-http_stub_status_module没有安装,需要进行编译一下.这里记录下模块单独安装步骤,就以–with-http_stub_status_module为例1,查看当前nginx编译参数 [[email protected] nginx-1.14.0]# /usr/local/nginx/sbin/nginx -Vnginx version: nginx/1.14.0built by gcc 4.8.5 2015

CentOS 6.5 Nginx 的编译安装、以及让nginx 支持 SSI 相对路径写法

1. nginx 下载 进入 http://nginx.org/en/download.html 下载,我是选择的 "Stable version" 稳定版本的下载 # wget http://nginx.org/download/nginx-1.6.2.tar.gz 2. 解压编译安装 # tar -zxvf nginx-1.6.2.tar.gz # cd nginx-1.6.2 安装一些nginx用到的依赖软件,如果不开启ssl可以不用安装openssl,回头用到时可以返回这里重新