Nginx+tomcat server environment load balancing configuration

NGINX_TOMCAT LoadBalanceConfiguration This configuration is already running in production. software: Nginx-1.0.8 Download address: http://nginx.org/download/nginx-1.0.8.tar.gz apache-tomcat-6.0.18 Download address: http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.18/bin/apache-tomcat-6.0.18.tar.gz jdk-6u27-linux-i586.bin Download address: http://download.oracle.com/auth/otn-pub/java/jdk/6u27-b07/jdk-6u27-linux-i586.bin?e=131891933 Pcre-8.00 Download link: http://nchc.dl.sourceforge.net/project/pcre/pcre/8.00/pcre-8.00.tar.gz Nginx-upstream-jvm-route-0.2 Download address: http://nginx-upstream-jvm-route.googlecode.com/files/nginx-upstream-jvm-route-0.2.tar.gz Configuration environment: Nginx server address: 192.168.1.20 Apache_tomcat1 server: 192.168.1.21 Apache_tomcat2 server: 192.168.1.22 One: Software installation steps Download all packages to: /usr/src path Configure nginx server: 1: Compile and install pcre-8.00 [root@mysql2 ~]# cd /usr/src/ [root@mysql2 src]# tar xf pcre-8.00.tar.gz [root@mysql2 src]# cd pcre-8.00/ [root@mysql2 pcre-8.00]# ./configure ;make;make install 2: Compile and install nginx-1.0.8 [root@mysql2 src]# tar xf nginx-upstream-jvm-route-0.1.tar.gz [root@mysql2 src]# tar xf nginx-1.0.8.tar.gz [root@mysql2 src]# cd nginx-1.0.8/ [root@mysql2 nginx-1.0.8]# patch -p0 < /usr/src/nginx_upstream_jvm_route/jvm_route.patch [root@mysql2 nginx-1.0.8]# ./configure –prefix=/usr/local/nginx –with-pcre=/usr/src/pcre-8.00/ –with-http_stub_status_module –with-http_sub_module –add-module=/usr/src/nginx_upstream_jvm_route 3: Modify the Nginx configuration file [root@mysql2 ~]# cd /usr/local/nginx/conf/ [root@mysql2 conf]# cp nginx.conf nginx.conf.back [root@mysql2 conf]# vi nginx.conf user nginx nginx; “ worker_processes 8; “ error_log logs/error.log; “ #error_log logs/error.log notice; “ #error_log logs/error.log info; “ pid logs/nginx.pid; worker_rlimit_nofile 65535; events { use epoll; “ “ worker_connections 10240; } http { “ “ include mime.types; “ “ default_type application/octet-stream; “ “ #log_format main ‘$remote_addr – $remote_user [$time_local] “$request”‘ “ “ # ‘$status $body_bytes_sent “$http_referer”‘ “ “ # ‘”$http_user_agent” “$http_x_forwarded_for”‘; “ “ #access_log logs/access.log main; “ “ sendfile on;…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索