Re: Re: Re: Re: Jonas 5.2.1 and Apache mod_jk
Celinio Fernandes <[email protected]> Sun, 2 Oct 2011 05:16:17 -0700 (PDT)
| Newsgroups | gmane.comp.java.objectweb.jonas |
|---|---|
| Message-ID | <[email protected]> |
---874068440-1916538081-1317557777=:21609 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Really ? I read that when it comes to load balancing and failure detection,= mod_jk is better than mod_proxy. =0A=0AAnyways, back to my problem :=0AIf = i hit the URL http://blabla.com:80/toto (port 80) it does not work. I get a= "Not found" error: "The requested URL /toto/ was not found on this server.= "=0A=0AThe URL http://blabla.com:80/works.=A0=A0 Same thing whether i use t= he IP or the hostname in worker's host definition:=0Aworker.worker1.host=0A= =0AI made another change in both tomcat6-server.xml and tomcat7-server.xml,= I added the jvmRoute to the worker :=0A=A0<Engine name=3D"JOnAS" defaultHo= st=3D"localhost" jvmRoute=3D"worker1">=0A=A0=0A=A0=0ASo, am i missing somet= hing ? =0AI do not want to do any load-balancing at the moment (i only have= one instance of Jonas anyways), I just want=0AApache to redirect the reque= st so that Jonas handles it.=0AThanks for helping.=0A=0A=0A=0A_____________= ___________________=0AFrom: S. Ali Tokmen <[email protected]>=0ATo: j= [email protected]=0ASent: Sunday, October 2, 2011 1:02 AM=0ASubject: [jonas] Re:= Re: Re: Jonas 5.2.1 and Apache mod_jk=0A=0A=0AHi Celinio=0A=0AOK, well my = personal recommendation is mod_proxy_ajp. It is=0A officially maintained= by the httpd project and has a great number of=0A stability and perform= ance improvements.=0A=0AIf you want to hit the AJP port, you should connect= to the Apache=0A httpd server; i.e. not visit on the 9000 port but the = 80 (or=0A whatever other Apache httpd) port.=0A=0ACheers=0A=0A=0AS. Ali = Tokmen=0Ahttp://ali.tokmen.com/ GSM (ch): +41 79 207 29 22 [Swisscom]=0AGSM= (fr): +33 66 43 00 555 [Orange]=0AGSM (tr): +90 555 266 52 73 [Avea] My AI= M, ICQ, MSN Messenger and Yahoo IM=0Acontact details are on http://contact.= ali.tokmen.com=0AOn 2011/10/01 19:26, Celinio Fernandes wrote: =0AHi Ali,= =0A>there is no specific reason.=0A>=0A>=0A>Anyways, how can i make sure my= webapp is using the mod_jk connector ?=0A>I have installed and configured = it in Apache and I have also configured it in Jonas.=0A>I can also see the = AJP/JK connector configured on port 8009 in the Jonas console admin.=0A>=0A= >=0A>Now how do i make sure my request hits Apache first and that Apache re= directs it to Jonas then ?=0A>=0A>=0A>=0A>=0A>_____________________________= ___=0A>From: S. Ali Tokmen <[email protected]>=0A>To: [email protected]= =0A>Sent: Saturday, October 1, 2011 5:49 PM=0A>Subject: [jonas] Re: Jonas 5= .2.1 and Apache mod_jk=0A>=0A>=0A>Hi Celinio=0A>=0A>Is there a spacific rea= son why you're using mod_jk under=0A Apache httpd 2.2 as opp= osed to the already embedded=0A mod_proxy_ajp?=0A>=0A>Thank = you=0A>=0A>=0A>S. Ali Tokmen http://ali.tokmen.com/ GSM (ch): +41 79 207 29= 22 [Swisscom]=0AGSM (fr): +33 66 43 00 555 [Orange]=0AGSM (tr): +90 555 26= 6 52 73 [Avea] My AIM, ICQ, MSN Messenger and Yahoo IM=0Acontact details ar= e on http://contact.ali.tokmen.com=0A>On 2011/10/01 18:37, Celinio Fernande= s wrote: =0A>Hi,=0A>>I am trying to interface my instance of Jonas 5.2.1 wi= th the connector mod_jk, in a Linux environment (CentOS).=0A>>=0A>>I have a= dded the module mod_jk.so to /usr/lib64/httpd/modules.=0A>>=0A>>=0A>>My ver= sion of Apache is 2.2=0A>>=0A>>=0A>>I have configured /etc/httpd/conf/httpd= .conf as the following :=0A>>=0A>>=0A>>LoadModule jk_module modules/mod_jk.= so =0A>>=0A>><IfModule jk_module>=0A>># Ou trouver workers.properties ?=0A>= >JkWorkersFile /etc/httpd/conf/workers.properties=0A>># Ou mettre la memoir= e partagee de jk=0A>>JkShmFile /etc/httpd/logs/mod_jk.shm=0A>># Ou mettre l= es logs jk=0A>>JkLogFile /etc/httpd/logs/mod_jk.log=0A>># Positionner le ni= veau des logs jk=0A [debug/error/info]=0A>>JkLogLevel = info=0A>># Selectionner lef ormat des logs pour le=0A = timestamp=0A>>JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "=0A>>#Format des lo= gs=0A>>JkRequestLogFormat "%w %m %V %T"=0A>># Envoyer les contextes dont le= nom commence par=0A test : /toto* vers le worker nomm= =E9 worker1=0A>>JkMount /toto*/* worker1=0A>># On peut placer ici plusieurs= JkMount si on a=0A plusieurs contextes traites=0A>># = par des workers differents=0A>></IfModule>=0A>>=0A>>=0A>>I have added the f= ollowing worker in /etc/httpd/conf/worker.properties :=0A>>=0A>>=0A>>=A0#De= fine 1 worker=0A>>=A0worker.list=3Dworker1=0A>>=A0=0A>>=A0#Set properties f= or worker1 (ajp13)=0A>>=A0worker.worker1.type=3Dajp13=0A>>=A0worker.worker1= .host=3Dblabla.com=0A>>=A0worker.worker1.port=3D8009=0A>>=0A>>=0A>>=0A>>Und= er /home/test/jonas-full-5.2.1/conf/=A0 I have configured both tomcat6-serv= er.xml and tomcat7-server.xml (since I do not know which one is used). I ha= ve uncommented the following line (changed port 9009 to 8009)=0A>>=0A>>=0A>= >=0A>>=A0 <Connector port=3D"8009" protocol=3D"AJP/1.3" redirectPort=3D"904= 3" />=0A>>=0A>>=0A>>My web app HTTP port in Jonas is configured to 9000.=0A= >>When I hit the URL http://blabla.com:9000/toto I can see in the Jonas log= s that Jonas is listening to that connector but I have no idea whether Apac= he has handled the request or not.=0A>>=0A>>=0A>>What can i do ? Am i missi= ng something ?=0A>>Thanks for helping.=0A>=0A> ---874068440-1916538081-1317557777=:21609 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable <html><body><div style=3D"color:#000; background-color:#fff; font-family:ti= mes new roman, new york, times, serif;font-size:12pt"><div><span>Really ? I= read that when it comes to load balancing and failure detection, mod_jk is= better than mod_proxy. <br><br>Anyways, back to my problem :<br>If i hit t= he URL http://blabla.com:80/toto (port 80) it does not work. I get a "Not f= ound" error: "The requested URL /toto/ was not found on this server."<br><b= r>The URL http://blabla.com:80/works. Same thing whether i use = the IP or the hostname in worker's host definition:<br>worker.worker1.host<= br><br>I made another change in both tomcat6-server.xml and tomcat7-server.= xml, I added the jvmRoute to the worker :<br> <Engine name=3D"JOnAS= " defaultHost=3D"localhost" jvmRoute=3D"worker1"><br> <br> <br= >So, am i missing something ? <br>I do not want to do any load-balancing at= the moment (i only have one instance of Jonas anyways), I just want<br>Apache to redirect the request so that Jonas handles it.<br>Thanks= for helping.</span></div><div><br></div><div style=3D"font-family: times n= ew roman, new york, times, serif; font-size: 12pt;"><div style=3D"font-fami= ly: times new roman, new york, times, serif; font-size: 12pt;"><font face= =3D"Arial" size=3D"2"><hr size=3D"1"><b><span style=3D"font-weight:bold;">F= rom:</span></b> S. Ali Tokmen <[email protected]><br><b><span s= tyle=3D"font-weight: bold;">To:</span></b> [email protected]<br><b><span style= =3D"font-weight: bold;">Sent:</span></b> Sunday, October 2, 2011 1:02 AM<br= ><b><span style=3D"font-weight: bold;">Subject:</span></b> [jonas] Re: Re: = Re: Jonas 5.2.1 and Apache mod_jk<br></font><br>=0A<div id=3D"yiv613542751"= >=0A =0A=0A =0A =0A <div>=0A Hi Celinio<br>=0A <br>=0A OK, w= ell my personal recommendation is mod_proxy_ajp. It is=0A officially mai= ntained by the httpd project and has a great number of=0A stability and = performance improvements.<br>=0A <br>=0A If you want to hit the AJP p= ort, you should connect to the Apache=0A httpd server; i.e. not visit on= the 9000 port but the 80 (or=0A whatever other Apache httpd) port.<br>= =0A <br>=0A Cheers<br>=0A <br>=0A <pre class=3D"yiv613542751moz= -signature">S. Ali Tokmen=0Ahttp://ali.tokmen.com/=0A=0AGSM (ch): +41 79 20= 7 29 22 [Swisscom]=0AGSM (fr): +33 66 43 00 555 [Orange]=0AGSM (tr): +90 55= 5 266 52 73 [Avea]=0A=0AMy AIM, ICQ, MSN Messenger and Yahoo IM=0Acontact d= etails are on http://contact.ali.tokmen.com</pre>=0A <br>=0A On 2011/= 10/01 19:26, Celinio Fernandes wrote:=0A <blockquote type=3D"cite">=0A = <div style=3D"color:#000;background-color:#fff;font-family:times new ro= man, new york, times, serif;font-size:12pt;">=0A <div><span>Hi Ali,<= /span></div>=0A <div><span>there is no specific reason.</span></div>= =0A <div><br>=0A <span></span></div>=0A <div><span>A= nyways, how can i make sure my webapp is using the=0A mod_jk con= nector ?</span></div>=0A <div><span>I have installed and configured = it in Apache and I=0A have also configured it in Jonas.</span></= div>=0A <div><span>I can also see the </span>AJP/JK connector=0A = configured on port 8009 in the Jonas console admin.</div>=0A <= div><br>=0A </div>=0A <div>Now how do i make sure my request = hits Apache first and=0A that Apache redirects it to Jonas then ?<= br>=0A </div>=0A <div><br>=0A </div>=0A <div st= yle=3D"font-family:times new roman, new york, times, serif;font-size:12pt;"= >=0A <div style=3D"font-family:times new roman, new york, times, s= erif;font-size:12pt;"><font face=3D"Arial" size=3D"2">=0A <hr = size=3D"1"><b><span style=3D"font-weight:bold;">From:</span></b>=0A = S. Ali Tokmen <a rel=3D"nofollow" class=3D"yiv613542751moz-txt-link-r= fc2396E" ymailto=3D"mailto:[email protected]" target=3D"_blank" href= =3D"mailto:[email protected]"><[email protected]></a><br>= =0A <b><span style=3D"font-weight:bold;">To:</span></b>=0A = <a rel=3D"nofollow" class=3D"yiv613542751moz-txt-link-abbreviated= " ymailto=3D"mailto:[email protected]" target=3D"_blank" href=3D"mailto:jonas@o= w2.org">[email protected]</a><br>=0A <b><span style=3D"font-weight= :bold;">Sent:</span></b>=0A Saturday, October 1, 2011 5:49 PM<= br>=0A <b><span style=3D"font-weight:bold;">Subject:</span></b= >=0A [jonas] Re: Jonas 5.2.1 and Apache mod_jk<br>=0A = </font><br>=0A <div id=3D"yiv613542751">=0A <div= > Hi Celinio<br>=0A <br>=0A Is there a spacif= ic reason why you're using mod_jk under=0A Apache httpd 2.2 = as opposed to the already embedded=0A mod_proxy_ajp?<br>=0A = <br>=0A Thank you<br>=0A <br>= =0A <pre class=3D"yiv613542751moz-signature">S. Ali Tokmen= =0A<a rel=3D"nofollow" class=3D"yiv613542751moz-txt-link-freetext" target= =3D"_blank" href=3D"http://ali.tokmen.com/">http://ali.tokmen.com/</a>=0A= =0AGSM (ch): +41 79 207 29 22 [Swisscom]=0AGSM (fr): +33 66 43 00 555 [Oran= ge]=0AGSM (tr): +90 555 266 52 73 [Avea]=0A=0AMy AIM, ICQ, MSN Messenger an= d Yahoo IM=0Acontact details are on <a rel=3D"nofollow" class=3D"yiv6135427= 51moz-txt-link-freetext" target=3D"_blank" href=3D"http://contact.ali.tokme= n.com">http://contact.ali.tokmen.com</a></pre>=0A <br>=0A = On 2011/10/01 18:37, Celinio Fernandes wrote:=0A = <blockquote type=3D"cite">=0A <div style=3D"color:#000;b= ackground-color:#fff;font-family:times new roman, new york, times, serif;fo= nt-size:12pt;">=0A <div>Hi,</div>=0A = <div>I am trying to interface my instance of Jonas=0A = 5.2.1 with the connector mod_jk, in a Linux=0A environ= ment (CentOS).<br>=0A </div>=0A <div>= I have added the module <a rel=3D"nofollow" target=3D"_blank" href=3D"http:= //mod_jk.so">mod_jk.so</a> to=0A /usr/lib64/httpd/modu= les.</div>=0A <div><br>=0A </div>=0A = <div>My version of Apache is 2.2</div>=0A = <div><br>=0A </div>=0A <div>I ha= ve configured /etc/httpd/conf/httpd.conf as=0A the fol= lowing :</div>=0A <div><br>=0A </div>= =0A <div>LoadModule jk_module modules/mod_jk.so <br>=0A = <br>=0A <IfModule jk_module>= ;<br>=0A # Ou trouver workers.properties ?<br>=0A = JkWorkersFile /etc/httpd/conf/workers.properties<br>=0A = # Ou mettre la memoire partagee de jk<br>=0A = JkShmFile /etc/httpd/logs/mod_jk.shm<br>=0A = # Ou mettre les logs jk<br>=0A JkLogFile /etc/httpd/lo= gs/mod_jk.log<br>=0A # Positionner le niveau des logs = jk=0A [debug/error/info]<br>=0A J= kLogLevel info<br>=0A # Selectionner lef ormat des log= s pour le=0A timestamp<br>=0A JkL= ogStampFormat "[%a %b %d %H:%M:%S %Y] "<br>=0A #Format= des logs<br>=0A JkRequestLogFormat "%w %m %V %T"<br>= =0A # Envoyer les contextes dont le nom commence par= =0A test : /toto* vers le worker nomm=E9 worker1<br>= =0A JkMount /toto*/* worker1<br>=0A = # On peut placer ici plusieurs JkMount si on a=0A p= lusieurs contextes traites<br>=0A # par des workers di= fferents<br>=0A </IfModule></div>=0A = <div><br>=0A </div>=0A <div>I= have added the following worker in=0A /etc/httpd/conf= /worker.properties :</div>=0A <div><br>=0A = </div>=0A <div> #Define 1 worker<br>=0A = worker.list=3Dworker1<br>=0A &nb= sp;<br>=0A #Set properties for worker1 (ajp13)<b= r>=0A worker.worker1.type=3Dajp13<br>=0A = worker.worker1.host=3Dblabla.com<br>=0A = worker.worker1.port=3D8009<br>=0A </div>=0A = <div><br>=0A </div>=0A = <div>Under /home/test/jonas-full-5.2.1/conf/ I have=0A = configured both tomcat6-server.xml and=0A = tomcat7-server.xml (since I do not know which one=0A i= s used). I have uncommented the following line=0A (cha= nged port 9009 to 8009)<br>=0A </div>=0A = <div><br>=0A </div>=0A <div> = ; <Connector port=3D"8009" protocol=3D"AJP/1.3"=0A = redirectPort=3D"9043" /></div>=0A <div><br>=0A = </div>=0A <div>My web app HTTP port in Jona= s is configured to=0A 9000.</div>=0A = <div>When I hit the URL http://blabla.com:9000/toto=0A = I can see in the Jonas logs that Jonas is=0A listen= ing to that connector but I have no idea=0A whether Ap= ache has handled the request or not.</div>=0A <div><br>= =0A </div>=0A <div>What can i do ? Am= i missing something ?</div>=0A <div>Thanks for helping.= </div>=0A </div>=0A </blockquote>=0A = </div>=0A </div>=0A <br>=0A <br>=0A= </div>=0A </div>=0A </div>=0A </blockquote>=0A </= div>=0A=0A</div><br><br></div></div></div></body></html> ---874068440-1916538081-1317557777=:21609--