nginx-1.4.4 + tcp_proxy_module手动编译安装
2013-11-30 17:01
531 查看
Nginx开源软件默认没有提供TCP协议的负载均衡,下面记录一下我的安装过程:
1. 下载nginx最新稳定版的源码
1. 下载nginx最新稳定版的源码
mkdir /software cd /software yum install -y wget wget http://nginx.org/download/nginx-1.4.4.tar.gz[/code]
2. 解压至当前目录tar -zxvf nginx-1.4.4.tar.gz
3. 此外,nginx_tcp_proxy_module会用到openssl(http://www.openssl.org)的支持,安装中需要这个包,也需要zlib(http://www.zlib.net)包,所以同样的也都下载并解压放到nginx-1.4.4目录内。
. 安装nginx 默认需要pcre(http://www.pcre.org)包的支持,下载到并解压放入nginx-1.4.4 目录内。wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz wget http://zlib.net/zlib-1.2.8.tar.gz wget http://sourceforge.net/projects/pcre/files/pcre/8.33/pcre-8.33.tar.gz/download[/code]
4. 下载 nginx_tcp_proxy_module https://github.com/yaoweibin/nginx_tcp_proxy_modulewget https://github.com/yaoweibin/nginx_tcp_proxy_module/archive/v0.4.4.zip[/code]
5. 下载完成后解压生成目录nginx_tcp_proxy_module-master 并放到 nginx-1.4.4 目录内。
yum install -y unzip
6. 进入nginx目录,命令
cd nginx-1.4.4
8. 以补丁方式加入到nginx:
Bash代码
patch -p1 < nginx_tcp_proxy_module-master/tcp.patch
.
9. 配置安装,运行:
Bash代码
./configure --add-module=nginx_tcp_proxy_module-master --with-pcre=pcre-8.32 --with-openssl=openssl-1.0.1e --with-zlib=zlib-1.2.7 --with-poll_module --prefix=/home/lyh/softs/nginx-1.2.7/run
--prefix 建议是取绝对路径,好处是可以在任务位置定位到nginx命令启动,不会出现找不到配置文件的错误。
10. 编译,运行命令 :
Bash代码
make
编译可能需要5分钟左右,依机器配置时间会不同。
11. 编译完成后安装,命令:
Bash代码
make install
12. nginx-1.2.7/run/ 目录下即是安装后的文件,这种安装方式不会随系统启动自动启动服务,需要手动启动或用命令加入到自启动配置中。
准备好后(第7步)及以后的安装命令如下:
Bash代码
~$ cd nginx-1.2.7
~$ patch -p1 < nginx_tcp_proxy_module-master/tcp.patch
~$ ./configure --add-module=nginx_tcp_proxy_module-master --with-pcre=pcre-8.32 --with-openssl=openssl-1.0.1e --with-zlib=zlib-1.2.7 --with-poll_module --prefix=/home/lyh/softs/nginx-1.2.7/run
~$ make
~$ make install
nginx 与 tcp_proxy_module 如何搭配?实现TCP层负载均衡的?
相关文章推荐
- nginx-1.2.7 + tcp_proxy_module手动编译安装
- Nginx编译安装第三方模块http_substitutions_filter_module
- [LNAMP]Linux+Apache+Nginx+MySQL+PHP纯手动安装编译
- Centos6.5手动编译安装nginx
- Nginx+lua+http_checkmodule+tcp_checkmodule+动态监测与访问控制 安装
- 编译安装nginx with uwsgi module on centos
- nginx tcp代理模块nginx_tcp_proxy_module安装及使用
- centos7.2 源码编译安装nginx,实现tcp反向代理,不中断服务新增编译模块
- Linux下升级nginx,编译安装nginx-sticky-module
- linux软件管理之------编译安装nginx服务器并手动编写自动化运行脚本
- Nginx利用nginx_tcp_proxy_module代理sshd服务
- 给已经编译安装了的nginx 添加http_ssl_module模块
- 编译安装 nginx的http_stub_status_module监控其运行状态
- nginx 编译安装支持 upload progress module, upload module
- nginx外部模块编译安装之ngx_http_accesskey_module防盗链
- nginx-1.2.7+tcp_proxy_module负载均衡配置
- [linux] Nginx编译安装错误error: the HTTP rewrite module requires the PCRE library
- linux环境手动编译安装Nginx实践过程 附异常解决
- 编译安装nginx with uwsgi module on centos
- 编译安装 Nginx(添加 fastdfs-nginx-module 模块)异常