Nginx TCP Proxy模块的编译安装
这次用一个国内开发者在GitHub上的开源项目https://github.com/yaoweibin/nginx_tcp_proxy_module
我的系统已经安装了最新的Nginx,现在需要下载源代码编译出自己的版本。
wget http://nginx.org/download/nginx-1.5.3.tar.gz
tar zxvf nginx-1.5.3.tar.gz
然后获得nginx_tcp_proxy_module的项目:
git clone https://github.com/yaoweibin/nginx_tcp_proxy_module.git
现在给Nginx打补丁
cd nginx-1.5.3/
root@dean-GA-MA790XT-UD4P:/usr/src/nginx-1.5.3# patch -p1 < /usr/src/nginx_tcp_proxy_module/tcp.patch
patching file src/core/ngx_log.c
Hunk #1 succeeded at 69 (offset 3 lines).
patching file src/core/ngx_log.h
Hunk #1 succeeded at 30 (offset 1 line).
Hunk #2 succeeded at 38 (offset 1 line).
patching file src/event/ngx_event_connect.h
Hunk #1 succeeded at 33 (offset 1 line).
Hunk #2 succeeded at 44 (offset 1 line).
还要安装个ssl库
apt-get install libssl-dev
但是卸载掉自动安装的libstdc++6-4.7-dev, 因为我用的是gcc4.8.1
apt-get autoremove
好了,现在配置makefile,首先查看当前系统安装好的Nginx的配置选项:
nginx -V
nginx version: nginx/1.5.3
built by gcc 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1)
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-mail --with-mail_ssl_module --with-file-aio --with-http_spdy_module --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro' --with-ipv6
然后原封不动的使用这些配置参数,但是加上最后一个
--add-module=/usr/src/nginx_tcp_proxy_module
./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-mail --with-mail_ssl_module --with-file-aio --with-http_spdy_module --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro' --with-ipv6 --add-module=/usr/src/nginx_tcp_proxy_module
现在开始编译吧。
make
得到的nginx程序位于objs目录. 将nginx服务停掉,并替换之。
service nginx stop
mv /usr/sbin/nginx /usr/sbin/nginx_bk
/usr/src/nginx-1.5.3/objs# cp nginx /usr/sbin/
service nginx start
ps -def | grep nginx
root 23479 1 0 23:21 ? 00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
root 23480 23479 0 23:21 ? 00:00:00 nginx: worker process
root 23482 13006 0 23:21 pts/0 00:00:00 grep --color=auto nginx
Nginx TCP Proxy模块的编译安装的更多相关文章
- Nginx 最新版源码编译安装 包含常用模块作用及所需依赖
第一部分 Nginx最新版源码编译安装 1. 使用的模块 模块1:http_rewrite_module 基于正则匹配来实现重定向.依赖PCRE库,见依赖1 模块2:http_gzip_module ...
- nginx的proxy模块详解以及参数
文章来源 运维公会:nginx的proxy模块详解以及参数 使用nginx配置代理的时候,肯定是要用到http_proxy模块.这个模块也是在安装nginx的时候默认安装.它的作用就是将请求转发到相应 ...
- nginx tcp proxy 连接保持设置
根据前文Nginx tcp proxy module试用的设置,在测试环境中发现tcp连接经常掉线.在该项目站点上找到一个issue,也谈论这件事情,不过别人用在web socket协议上. 其实就是 ...
- swoole模块的编译安装:php编译安装swoole模块的代码
本篇文章给大家带来的内容是关于swoole模块的编译安装:php编译安装swoole模块的代码,有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助. 1.下载swoole 1 wget ht ...
- 安装成功的nginx,如何添加未编译安装模块(非覆盖安装http_image_filter_module)
背景:1.做了图片上传小项目.2.图片上传,需要多图管理.3.图片上传,需要存储到Fastdfs.4.Fastdfs上的图片,和Nginx结合.5.Nginx从Fastdfs获得的图片,需要使用缩略图 ...
- nginx之 nginx-1.9.7 编译安装、理论简介
nginx是一个web网站常用的高性能http和反向代理服务器,其具有较好的并发能力,被网易.百度.腾讯.新浪等网站广泛使用. 一. 理论简介 1.首先弄清楚正向代理和反向代理 正向代理:代理客户端, ...
- Nginx、MySQL、PHP 编译安装
RHEL 7.0 编译安装Nginx1.6.0+MySQL5.6.19+PHP5.5.14运行环境 准备篇: RHEL 7.0系统安装配置图解教程 http://www.jb51.net/os/192 ...
- nginx TCP 代理& windows傻瓜式安装
一.下载nginx Windows http://nginx.org/en/download.html 二.解压到目录 三.进入目录并start nginx.exe即可启动 cd d:/java/ng ...
- 开始Nginx的SSL模块
nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/n ...
随机推荐
- aiohttp
发起请求 async def fetch(): async with aiohttp.ClientSession() as session: async with session.get('https ...
- Hibernate 使用MyEclipse简化开发
在平时开发中写配置文件比较繁琐,在这里写一下如何使用myEclipse简化开发. 1.打开MyEclipse,创建数据库连接 单机测试连接按钮,如果出现成功建立连接,则连接成功. 然后Finish 2 ...
- 「HAOI2015」按位或
「HAOI2015」按位或 解题思路 : 这类期望题一眼 \(\text{Min-Max}\) 容斥,只需要稍微推一下如何求 \(E(minS)\) 即可. \[ E(minS) = \frac{1} ...
- [APIO2010]特别行动队 --- 斜率优化DP
[APIO2010]特别行动队 题面很直白,就不放了. 太套路了,做起来没点感觉了. \(dp(i)=dp(j)+a*(s(i)-s(j))^{2}+b*(s(i)-s(j))+c\) 直接推出一个斜 ...
- NOIP 解题有感
算法方面: 在搜索问题上,包括贪心等没有固定算法的题目,还有输出格式(包括输入格式)特别容易出错.这也是解题选手的弱点. 1.做搜索题把步骤先用文字写下来,再转换成代码,以避免敲代码时疏漏某个条件. ...
- 人脸对齐SDM原理----Supervised Descent Method and its Applications to Face Alignment
最近组里研究了SDM算法在人脸对齐中的应用,是CMU的论文<Supervised Descent Method and its Applications to Face Alignment> ...
- 强悍的javascript手势库
/** * Toucher * git:https://github.com/cometwo/Toucher-1 */ "use strict"; (function (root, ...
- Rob Pike 的 5 个编程原则
原则 1. 你没有办法预测每个程序的运行时间,瓶颈会出现在出乎意料的地方,所以在分析瓶颈原因之前,先不要盲目猜测. 原则 2. 测试(measure).在测试之前不要优化程序,即使在测试之后也要慎重, ...
- java socket 长连接 短连接
长连接 是一旦一个客户端登陆上服务器,其与服务器之间的连接就不关闭,不管他们之间进行了多少次交易,直到客户端退出登陆或网络出现故障.这种技术在联机交易系统实现有利于提高效率. 短连接是客户端每发一个请 ...
- Nuget server on IIS6 returns 404
Nuget server on IIS6 returns 404 when downloading package after upgrade 2011年9月2日 8:03:30 (GMT Dayli ...