<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Debian 6下配置Nginx Tomcat负载均衡(支持Session共享)
一、配置环境.
1、Srv76.example.zqin
² OS:Debian 6.0(Nginx Tomcat)
² FQDN:srv76.exampel.zqin
² IP:192.168.159.76
² GW:192.168.159.254
² DNS:202.103.24.68
2、Srv77.example.zqin
² OS:Debian 6.0(Tomcat)
² FQDN:srv77.exampel.zqin
² IP:192.168.159.77
² GW:192.168.159.254
² DNS:202.103.24.68
二、在Srv76上安装Nginx.
1、使用如下命令安装编译Nginx所需软件包.
srv76:~# apt-get upgrade
srv76:~# apt-get install zlibc libpcre -dev bzip2 autoconf automake g gcc
make libssl-dev libpcre3-dev build-essential
2、使用如下命令下载并编译安装Nginx及nginx_upstream_jvm_route.
srv76:~# adduser --system --no-create-home --disabled-login
--disabled-password --group nginx
srv76:~# cd /usr/src
srv76:src# wget http://nginx.org/download/nginx-1.0.4.tar.gz
srv76:src# svn checkout http://nginx-upstream-jvm-route.googlecode.com/svn/trunk/ nginx-upstream-jvm-route-read-only
srv76:src# tar -xvzf nginx-1.0.4.tar.gz
srv76:src# cd nginx-1.0.4
srv76:nginx-1.0.4# patch -p0 < ../nginx-upstream-jvm-route-read-only/jvm_route.patch
srv76:nginx-1.0.4# ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx
--with-http_stub_status_module --with-http_ssl_module
--with-pcre --add-module=../nginx-upstream-jvm-route-read-only
srv76:nginx-1.0.4# make && make install
3、}
}本文出自 “相濡以沫” 博客,请务必保留此出处http://onlyzq.blog.51cto.com/1228/591362
|