Configuration Apache for multiple wars on Tomcat with multipledomains
am 02.10.2009 17:15:53 von Cyril Vieville --_000_A252D160BE252A4E816D21440EEC1B6B587581076Fstoms1lanlo ca_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
I have an apache server used as load balancer for multiple tomcat servers c=
lusters with mod_jk.
The configuration is to have different workers on different servers and som=
etimes port as well :
#####
# START
# Nodes
JkWorkerProperty worker.server_1_1.host=3Dserver40
JkWorkerProperty worker.server_1_1.port=3D8009
JkWorkerProperty worker.server_1_1.reference=3Dworker.tmplt_worker
JkWorkerProperty worker.server_2_1.host=3Dserver41
JkWorkerProperty worker.server_2_1.port=3D8009
JkWorkerProperty worker.server_2_1.reference=3Dworker.tmplt_worker
# Loadbalancer
JkWorkerProperty worker.lb_cluster1.reference=3Dworker.tmplt_balancer
JkWorkerProperty worker.lb_cluster1.balance_workers=3Dserver_1_1,server_2_1
# END
#####
We use ServerAlias and our DNS registration (in direction of the apache ser=
ver of course) to have an URL by application. For this one, it=B4s cluster1=
..mydomain.com
Everything worked fine till today as we have a new need. We used to install=
only one war on each Tomcat server with the context path "" so the URL was=
http://cluster1.mydomain.com but now we have to host more than 1 war by to=
mcat server. So the Context path will change to the name of the war (no pro=
blem for that) but we don=B4t want to use
cluster1.mydomain.com/war1
cluster1.mydomain.com/war2
but
war1.mydomain.com
war2.mydomain.com
what should I do or add ? Is it on the Apache or mod_jk configuration, or o=
n the Tomcat side ?
Of course I need to add some ServerAlias lines but I don=B4t know what to d=
o with the rest ...
Thanks,
Cyril Vi=E9ville
--_000_A252D160BE252A4E816D21440EEC1B6B587581076Fstoms1lanlo ca_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
1">
xmlns:x=3D"urn:schemas-microsoft-com:office:excel" xmlns:p=3D"urn:schemas-m=
icrosoft-com:office:powerpoint" xmlns:a=3D"urn:schemas-microsoft-com:office=
:access" xmlns:dt=3D"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s=3D"=
uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs=3D"urn:schemas-microsof=
t-com:rowset" xmlns:z=3D"#RowsetSchema" xmlns:b=3D"urn:schemas-microsoft-co=
m:office:publisher" xmlns:ss=3D"urn:schemas-microsoft-com:office:spreadshee=
t" xmlns:c=3D"urn:schemas-microsoft-com:office:component:spread sheet" xmlns=
:odc=3D"urn:schemas-microsoft-com:office:odc" xmlns:oa=3D"urn:schemas-micro=
soft-com:office:activation" xmlns:html=3D"http://www.w3.org/TR/REC-html40" =
xmlns:q=3D"http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc=3D"http://m=
icrosoft.com/officenet/conferencing" xmlns:D=3D"DAV:" xmlns:Repl=3D"http://=
schemas.microsoft.com/repl/" xmlns:mt=3D"http://schemas.microsoft.com/share=
point/soap/meetings/" xmlns:x2=3D"http://schemas.microsoft.com/office/excel=
/2003/xml" xmlns:ppda=3D"http://www.passport.com/NameSpace.xsd" xmlns:ois=
=3D"http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir=3D"http://=
schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds=3D"http://www.w3=
..org/2000/09/xmldsig#" xmlns:dsp=3D"http://schemas.microsoft.com/sharepoint=
/dsp" xmlns:udc=3D"http://schemas.microsoft.com/data/udc" xmlns:xsd=3D"http=
://www.w3.org/2001/XMLSchema" xmlns:sub=3D"http://schemas.microsoft.com/sha=
repoint/soap/2002/1/alerts/" xmlns:ec=3D"http://www.w3.org/2001/04/xmlenc#"=
xmlns:sp=3D"http://schemas.microsoft.com/sharepoint/" xmlns:sps=3D"http://=
schemas.microsoft.com/sharepoint/soap/" xmlns:xsi=3D"http://www.w3.org/2001=
/XMLSchema-instance" xmlns:udcs=3D"http://schemas.microsoft.com/data/udc/so=
ap" xmlns:udcxf=3D"http://schemas.microsoft.com/data/udc/xmlfile " xmlns:udc=
p2p=3D"http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf=3D"http:/=
/schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss=3D"http://sche=
mas.microsoft.com/office/2006/digsig-setup" xmlns:dssi=3D"http://schemas.mi=
crosoft.com/office/2006/digsig" xmlns:mdssi=3D"http://schemas.openxmlformat=
s.org/package/2006/digital-signature" xmlns:mver=3D"http://schemas.openxmlf=
ormats.org/markup-compatibility/2006" xmlns:m=3D"http://schemas.microsoft.c=
om/office/2004/12/omml" xmlns:mrels=3D"http://schemas.openxmlformats.org/pa=
ckage/2006/relationships" xmlns:spwp=3D"http://microsoft.com/sharepoint/web=
partpages" xmlns:ex12t=3D"http://schemas.microsoft.com/exchange/service s/20=
06/types" xmlns:ex12m=3D"http://schemas.microsoft.com/exchange/service s/200=
6/messages" xmlns:pptsl=3D"http://schemas.microsoft.com/sharepoint/soap/ Sli=
deLibrary/" xmlns:spsl=3D"http://microsoft.com/webservices/SharePointPor tal=
Server/PublishedLinksService" xmlns:Z=3D"urn:schemas-microsoft-com:" xmlns:=
st=3D"" xmlns=3D"http://www.w3.org/TR/REC-html40">
ans-serif";
color:#1F497D'>Hi,
ans-serif";
color:#1F497D'>
ly:"Arial","sans-serif";
color:#1F497D'>I have an apache server used as load balancer for multiple
tomcat servers clusters with mod_jk.
ly:"Arial","sans-serif";
color:#1F497D'>
ly:"Arial","sans-serif";
color:#1F497D'>The configuration is to have different workers on different
servers and sometimes port as well :
ly:"Arial","sans-serif";
color:#1F497D'>
ly:"Arial","sans-serif";
color:#1F497D'>#####
ly:"Arial","sans-serif";
color:#1F497D'># START
ly:"Arial","sans-serif";
color:#1F497D'>
ly:"Arial","sans-serif";
color:#1F497D'># Nodes
ly:"Arial","sans-serif";
color:#1F497D'>
ly:"Arial","sans-serif";
color:#1F497D'>JkWorkerProperty worker.server_1_1.host=3Dserver40
ly:"Arial","sans-serif";
color:#1F497D'>JkWorkerProperty worker.server_1_1.port=3D8009
ly:"Arial","sans-serif";
color:#1F497D'>JkWorkerProperty worker.server_1_1.reference=3Dworker.tmplt_=
worker
ly:"Arial","sans-serif";
color:#1F497D'>
ly:"Arial","sans-serif";
color:#1F497D'>JkWorkerProperty worker.server_2_1.host=3Dserver41
ly:"Arial","sans-serif";
color:#1F497D'>JkWorkerProperty worker.server_2_1.port=3D8009
ly:"Arial","sans-serif";
color:#1F497D'>JkWorkerProperty worker.server_2_1.reference=3Dworker.tmplt_=
worker
ly:"Arial","sans-serif";
color:#1F497D'>
ly:"Arial","sans-serif";
color:#1F497D'># Loadbalancer
ly:"Arial","sans-serif";
color:#1F497D'>
ly:"Arial","sans-serif";
color:#1F497D'>JkWorkerProperty
worker.lb_cluster1.reference=3Dworker.tmplt_balancer
ly:"Arial","sans-serif";
color:#1F497D'>JkWorkerProperty
worker.lb_cluster1.balance_workers=3Dserver_1_1,server_2_1
ly:"Arial","sans-serif";
color:#1F497D'>
ly:"Arial","sans-serif";
color:#1F497D'># END
ly:"Arial","sans-serif";
color:#1F497D'>#####
ly:"Arial","sans-serif";
color:#1F497D'>
ly:"Arial","sans-serif";
color:#1F497D'>We use ServerAlias and our DNS registration (in direction of=
the
apache server of course) to have an URL by application. For this one, it=B4=
s
cluster1.mydomain.com
ly:"Arial","sans-serif";
color:#1F497D'>
ly:"Arial","sans-serif";
color:#1F497D'>Everything worked fine till today as we have a new need. We =
used
to install only one war on each Tomcat server with the context path “=
” so the
URL was http://cluster1.mydomain.com but now we have to host more than 1 wa=
r by
tomcat server. So the Context path will change to the name of the war (no
problem for that) but we don=B4t want to use
ly:"Arial","sans-serif";
color:#1F497D'>
ly:"Arial","sans-serif";
color:#1F497D'>cluster1.mydomain.com/war1
ly:"Arial","sans-serif";
color:#1F497D'>cluster1.mydomain.com/war2
ly:"Arial","sans-serif";
color:#1F497D'>
ly:"Arial","sans-serif";
color:#1F497D'>but
ly:"Arial","sans-serif";
color:#1F497D'>
ly:"Arial","sans-serif";
color:#1F497D'>war1.mydomain.com
ly:"Arial","sans-serif";
color:#1F497D'>war2.mydomain.com
ly:"Arial","sans-serif";
color:#1F497D'>
ly:"Arial","sans-serif";
color:#1F497D'>what should I do or add ? Is it on the Apache or mod_jk
configuration, or on the Tomcat side ?
ly:"Arial","sans-serif";
color:#1F497D'>Of course I need to add some ServerAlias lines but I don=B4t=
know
what to do with the rest ...
ly:"Arial","sans-serif";
color:#1F497D'>
ly:"Arial","sans-serif";
color:#1F497D'>Thanks,
ly:"Arial","sans-serif";
color:#1F497D'>
ly:"Arial","sans-serif";
color:#1F497D'>Cyril Vi=E9ville
:10.0pt;
font-family:"Times New Roman","serif";color:#1F497D'>
--_000_A252D160BE252A4E816D21440EEC1B6B587581076Fstoms1lanlo ca_--