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
编译完成后千万不要make && make install(不然会覆盖安装nginx)
编译成功后备份旧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
到此,nginx的upload模块安装完毕
nginx重新编译安装upload模块的更多相关文章
- 原已经安装好的nginx,现在需要添加一个未被编译安装的模块--echo-nginx-module-0.56
为了测试一个NGINX变量,将NGINX加了一个编译模板echo-nginx-module-0.56. 参照如下文件 1,先看以前NGINX有哪些东东. sbin/nginx -Vnginx vers ...
- Nginx编译安装第三方模块http_substitutions_filter_module2222
Nginx编译安装第三方模块http_substitutions_filter_module Rming -- 阅读 安装 Http 编译 module filter nginx 模块 >> ...
- Nginx编译安装第三方模块http_substitutions_filter_module
Nginx编译安装第三方模块http_substitutions_filter_module 分类:服务器技术 作者:rming 时间:-- . >>ngx_http_substitu ...
- 【01】Nginx:编译安装/动态添加模块
写在前面的话 说起 Nginx,别说运维,就是很多开发人员也很熟悉,毕竟如今已经 2019 年了,Apache 更多的要么成为了历史,要么成为了历史残留. 我们在提及 Nginx 的时候,一直在强调他 ...
- 已经编译安装的nginx/tenginx编译增加新模块
只适用于自行编译安装的nginx配置 业务变更带来的Nginx增加模块需求 由于业务从php转为go开发,需要用到Http2的协议.这种协议在Nginx上需要http_v2_module这个模块的支持 ...
- 初识Nginx及编译安装Nginx
初识Nginx及编译安装Nginx 环境说明: 系统版本 CentOS 6.9 x86_64 软件版本 nginx-1.12.2 1.什么是Nginx? 如果你听说或使用过Apache软件 ...
- Nginx 的编译安装和URL地址重写
本文转自:http://www.178linux.com/14119#rd?sukey=ecafc0a7cc4a741b573a095a3eb78af6b4c9116b74d0bbc9844d8fc5 ...
- vim编译安装+lua模块
vim编译安装+lua模块 使用背景:代码自动补全插件,需要安装lua模块 安装准备,首先下载安装vim所依赖的其它安装包,ncurses,lua,readline,vim 源码下载,编译安装 ncu ...
- linux 编译安装PHP模块
本文移到:http://www.phpgay.com/Article/detail/classid/6/id/54.html linux 编译安装PHP模块 1.首先你要有你服务器上安装的PHP的版 ...
随机推荐
- kafka——分布式的消息队列系统
总听公司人说kafka kafka... 所以这玩意到底是个啥? 好像是一个高级版的消息队列,什么高吞吐量,数据持久,消息均衡,emmm https://blog.csdn.net/nawenqian ...
- 结合webpack实现children子路由,抽离路由模块
demo结构 package.json.webpack.config.js.index.html与上一篇博客相同. main.js // 这是项目的入口js文件 // import $ from 'j ...
- MoreExecutors工具类使用
MoreExecutors是guava提供的工具类,是对jdk自带的Executors工具类的扩展,主要方法如下: 1.addDelayedShutDown()方法的两个重载: public stat ...
- 2.Python环境搭建Window、mac、linux
1.Windows安装Python详解 使用任何高级编程语言都需要有一个自己的编程环境,Python 也不例外.只要使用 Python,就必须要配置 Python 的开发和运行环境. Python 本 ...
- 9.并发编程--ThreadLocal
并发编程--ThreadLocal 1. ThreadLocal : * 线程局部变量,是一种多个线程间并发访问变量的解决方案. * 与其使用synchronized等加锁的方式,ThreadLoca ...
- c/c++运算符
1.算术运算符(+ - / * %) 2.移位运算符 移运算符:操作数必须是整形,>>,逻辑左移左边移入的位用0填充,算数左移左边移入的的位用符号位补齐.(无符号数为逻辑左移,对于 ...
- mysq远程连接报错,host..
在本机登入mysql后,更改"mysql"数据库里的"user"表里的"host"项,从"localhost"改为'%' ...
- nginx检查报错:nginx: [emerg] "server" directive is not allowed here in
想检查一个配置文件是否正确,-c 指定之后发现有报错,如下: [root@op-2:~# nginx -t -c /etc/nginx/conf.d/default.conf nginx: [emer ...
- TiDB单机安装测试
TiDB单机安装测试 CentOS7.3安装MySQL5.6 1:下载TiDB安装包# cd /opt/source# wget http://download.pingcap.org/tidb-la ...
- 测试-修补程序-Hotfix:百科
ylbtech-测试-修补程序-Hotfix:百科 1.返回顶部 1. Hotfix是微软公司研发的一个程序,针对某一个具体的系统漏洞或安全问题而发布的专门解决该漏洞或安全问题,通常称为修补程序. ...