- Using Eclipse WTP, create two Tomcat instances and assign them different ports for Admin port, HTTP and AJP
- Go into server.xml of each server:
- Add the jvmRoute attribute at the
element and specify a value (e.g. primary, secondary) - Uncomment the line where
is present - In the application web.xml add the <distributable/> element, directly under the web-app tag
- Configure the file httpd.conf as follows:
- Uncomment the following modules:
- LoadModule proxy_module modules/mod_proxy.so
- LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
- LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
- LoadModule proxy_connect_module modules/mod_proxy_connect.so
- LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
- LoadModule proxy_http_module modules/mod_proxy_http.so
- Add the following VirtualHost element:
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid scolonpathdelim=On
ProxyPassReverse / balancer://mycluster/
<Proxy balancer://mycluster>
BalancerMember ajp://localhost:8009 route=primary loadfactor=10
BalancerMember ajp://localhost:8011 route=secondary loadfactor=10
</Proxy>
</VirtualHost>
Here you can download the files:
https://dl.dropbox.com/u/1580227/blogspot/httpd.conf
https://dl.dropbox.com/u/1580227/blogspot/server1.xml
https://dl.dropbox.com/u/1580227/blogspot/server2.xml
No comments:
Post a Comment