Hi All,
I have a question for any Apache Tomcat master.
How you host multiple websites with Apache2 and Tomcat Cluster ??
It would be nice to have separate log files ??
I am using AJP and wondering how this would work. Also, with sticky sessions
and separate websites ??
Thanks for all help.
Phil
====================
This is my 000-default file from etc/apache2/sites-enabled (ip's have been
changed for display)
=========================================
NameVirtualHost 22.33.444.114:80
<VirtualHost 22.33.444.114:80>
JkMount /*.jsp loadbalancer
JkMount /*.jsf loadbalancer
JkMount /servlet/* loadbalancer
JkMount /* loadbalancer
JkStripSession On
ServerAdmin webmas...@localhost
ServerName "www.testApp.com"
ServerAlias "www.testApp.com"
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride all
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
# This directive allows us to have apache2's default start
page
# in /apache2-default/, but still have / go to the right
place
RedirectMatch ^/$ /apache2-default/
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride all
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
FileETag None
ExpiresDefault "access plus 4 weeks"
# 480 weeks
<FilesMatch "\.(jsf|ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=490304000, public"
</FilesMatch>
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
</VirtualHost>
<VirtualHost *:80>
JkMount /*.jsp loadbalancer
JkMount /*.jsf loadbalancer
JkMount /servlet/* loadbalancer
JkMount /* loadbalancer
JkStripSession On
ServerAdmin webmas...@localhost
ServerName "www.testApp.com"
ServerAlias "www.testApp.com"
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride all
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
# This directive allows us to have apache2's default start
page
# in /apache2-default/, but still have / go to the right
place
RedirectMatch ^/$ /apache2-default/
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride all
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
FileETag None
ExpiresDefault "access plus 4 weeks"
# 480 weeks
<FilesMatch "\.(jsf|ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=490304000, public"
</FilesMatch>
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
</VirtualHost>
=========================================
Here is the workers.properties file.
=========================================
# workers.properties
ps=/
# list the workers by name
worker.list=tomcat1,tomcat2,tomcat3,loadbalancer
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
# ----> lbfactor must be > 0
# ----> Low lbfactor means less work done by the worker.
# ------------------------
# First tomcat server
# ------------------------
worker.tomcat1.port=18009
worker.tomcat1.host=192.168.70.101
worker.tomcat1.type=ajp13
worker.tomcat1.lbfactor=33
# ------------------------
# Second tomcat server
# ------------------------
worker.tomcat2.port=19009
worker.tomcat2.host=192.168.70.102
worker.tomcat2.type=ajp13
worker.tomcat2.lbfactor=33
# ------------------------
# Third tomcat server
# ------------------------
worker.tomcat3.port=20009
worker.tomcat3.host=192.168.70.103
worker.tomcat3.type=ajp13
worker.tomcat3.lbfactor=33
# -----------------------
# Load Balancer worker
# ------------------------
#
# The loadbalancer (type lb) worker performs weighted round-robin
# load balancing with sticky sessions.
# Note:
# ----> If a worker dies, the load balancer will check its state
# once in a while. Until then all work is redirected to peer
# worker.
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=tomcat1,tomcat2,tomcat3
#
# END workers.properties
#
--
View this message in context:
http://www.nabble.com/How-do-I-host-multiple-websites-with-Apache2-and-Tomcat-Cluster----tp23239694p23239694.html
Sent from the Tomcat - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]