Re: Re: Re: Re: Re: Re: Jonas 5.2.1 and Apache mod_jk

Benoit Pelletier <[email protected]> Mon, 03 Oct 2011 09:39:27 +0200
Newsgroups gmane.comp.java.objectweb.jonas
Organization BULL SAS
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------070803030402030108050406
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

Hi All,
> Hi Celinio
>
> Hmm... Where did you read that?
>
> Anyhow, based on your description of the situation I guess your=20
> workers.properties file is not good. I think:
>
>     JkMount /toto*/* worker1
>
>
> Has to be corrected with:
>
>     JkMount /toto* worker1
>
You should add both

    JkMount /toto worker1
    JkMount /toto/* worker1
    JkMountCopy Allou can

BTW, did you take a look to the mod_jk's logs ? See=20
/etc/httpd/logs/mod_jk.log. If needed, you may enable the debug level.

Regards

>
> or
>
>     JkMount /toto/* worker1
>
>
> Also, try visiting http://blabla.com:80/toto/ (with the final slash)
>
> Thank you
>
> S. Ali Tokmen
> http://ali.tokmen.com/
>
> GSM (ch): +41 79 207 29 22 [Swisscom]
> GSM (fr): +33 66 43 00 555 [Orange]
> GSM (tr): +90 555 266 52 73 [Avea]
>
> My AIM, ICQ, MSN Messenger and Yahoo IM
> contact details are on http://contact.ali.tokmen.com
>
> On 2011/10/02 15:16, Celinio Fernandes wrote:
>> Really ? I read that when it comes to load balancing and failure=20
>> detection, mod_jk is better than mod_proxy.
>>
>> Anyways, back to my problem :
>> If i hit the URL http://blabla.com:80/toto (port 80) it does not=20
>> work. I get a "Not found" error: "The requested URL /toto/ was not=20
>> found on this server."
>>
>> The URL http://blabla.com:80/works.   Same thing whether i use the IP=20
>> or the hostname in worker's host definition:
>> worker.worker1.host
>>
>> I made another change in both tomcat6-server.xml and=20
>> tomcat7-server.xml, I added the jvmRoute to the worker :
>>  <Engine name=3D"JOnAS" defaultHost=3D"localhost" jvmRoute=3D"worker1"=
>
>> =20
>> =20
>> So, am i missing something ?
>> I do not want to do any load-balancing at the moment (i only have one=20
>> instance of Jonas anyways), I just want
>> Apache to redirect the request so that Jonas handles it.
>> Thanks for helping.
>>
>> ----------------------------------------------------------------------=
--
>> *From:* S. Ali Tokmen <[email protected]>
>> *To:* [email protected]
>> *Sent:* Sunday, October 2, 2011 1:02 AM
>> *Subject:* [jonas] Re: Re: Re: Jonas 5.2.1 and Apache mod_jk
>>
>> Hi Celinio
>>
>> OK, well my personal recommendation is mod_proxy_ajp. It is=20
>> officially maintained by the httpd project and has a great number of=20
>> stability and performance improvements.
>>
>> If you want to hit the AJP port, you should connect to the Apache=20
>> httpd server; i.e. not visit on the 9000 port but the 80 (or whatever=20
>> other Apache httpd) port.
>>
>> Cheers
>>
>> S. Ali Tokmen
>> http://ali.tokmen.com/
>>
>> GSM (ch): +41 79 207 29 22 [Swisscom]
>> GSM (fr): +33 66 43 00 555 [Orange]
>> GSM (tr): +90 555 266 52 73 [Avea]
>>
>> My AIM, ICQ, MSN Messenger and Yahoo IM
>> contact details are on http://contact.ali.tokmen.com
>>
>> On 2011/10/01 19:26, Celinio Fernandes wrote:
>>> Hi Ali,
>>> there is no specific reason.
>>>
>>> Anyways, how can i make sure my webapp is using the mod_jk connector =
?
>>> I have installed and configured it in Apache and I have also=20
>>> configured it in Jonas.
>>> I can also see the AJP/JK connector configured on port 8009 in the=20
>>> Jonas console admin.
>>>
>>> Now how do i make sure my request hits Apache first and that Apache=20
>>> redirects it to Jonas then ?
>>>
>>> ---------------------------------------------------------------------=
---
>>> *From:* S. Ali Tokmen <[email protected]>=20
>>> <mailto:[email protected]>
>>> *To:* [email protected] <mailto:[email protected]>
>>> *Sent:* Saturday, October 1, 2011 5:49 PM
>>> *Subject:* [jonas] Re: Jonas 5.2.1 and Apache mod_jk
>>>
>>> Hi Celinio
>>>
>>> Is there a spacific reason why you're using mod_jk under Apache=20
>>> httpd 2.2 as opposed to the already embedded mod_proxy_ajp?
>>>
>>> Thank you
>>>
>>> S. Ali Tokmen
>>> http://ali.tokmen.com/
>>>
>>> GSM (ch): +41 79 207 29 22 [Swisscom]
>>> GSM (fr): +33 66 43 00 555 [Orange]
>>> GSM (tr): +90 555 266 52 73 [Avea]
>>>
>>> My AIM, ICQ, MSN Messenger and Yahoo IM
>>> contact details are on http://contact.ali.tokmen.com
>>>
>>> On 2011/10/01 18:37, Celinio Fernandes wrote:
>>>> Hi,
>>>> I am trying to interface my instance of Jonas 5.2.1 with the=20
>>>> connector mod_jk, in a Linux environment (CentOS).
>>>> I have added the module mod_jk.so <http://mod_jk.so> to=20
>>>> /usr/lib64/httpd/modules.
>>>>
>>>> My version of Apache is 2.2
>>>>
>>>> I have configured /etc/httpd/conf/httpd.conf as the following :
>>>>
>>>> LoadModule jk_module modules/mod_jk.so
>>>>
>>>> <IfModule jk_module>
>>>> # Ou trouver workers.properties ?
>>>> JkWorkersFile /etc/httpd/conf/workers.properties
>>>> # Ou mettre la memoire partagee de jk
>>>> JkShmFile /etc/httpd/logs/mod_jk.shm
>>>> # Ou mettre les logs jk
>>>> JkLogFile /etc/httpd/logs/mod_jk.log
>>>> # Positionner le niveau des logs jk [debug/error/info]
>>>> JkLogLevel info
>>>> # Selectionner lef ormat des logs pour le timestamp
>>>> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
>>>> #Format des logs
>>>> JkRequestLogFormat "%w %m %V %T"
>>>> # Envoyer les contextes dont le nom commence par test : /toto* vers=20
>>>> le worker nomm=E9 worker1
>>>> JkMount /toto*/* worker1
>>>> # On peut placer ici plusieurs JkMount si on a plusieurs contextes=20
>>>> traites
>>>> # par des workers differents
>>>> </IfModule>
>>>>
>>>> I have added the following worker in=20
>>>> /etc/httpd/conf/worker.properties :
>>>>
>>>>  #Define 1 worker
>>>>  worker.list=3Dworker1
>>>> =20
>>>>  #Set properties for worker1 (ajp13)
>>>>  worker.worker1.type=3Dajp13
>>>>  worker.worker1.host=3Dblabla.com
>>>>  worker.worker1.port=3D8009
>>>>
>>>> Under /home/test/jonas-full-5.2.1/conf/  I have configured both=20
>>>> tomcat6-server.xml and tomcat7-server.xml (since I do not know=20
>>>> which one is used). I have uncommented the following line (changed=20
>>>> port 9009 to 8009)
>>>>
>>>>   <Connector port=3D"8009" protocol=3D"AJP/1.3" redirectPort=3D"9043=
" />
>>>>
>>>> My web app HTTP port in Jonas is configured to 9000.
>>>> When I hit the URL http://blabla.com:9000/toto I can see in the=20
>>>> Jonas logs that Jonas is listening to that connector but I have no=20
>>>> idea whether Apache has handled the request or not.
>>>>
>>>> What can i do ? Am i missing something ?
>>>> Thanks for helping.
>>>
>>>
>>
>>


--=20

----------------------------------------------------------------
Benoit Pelletier
http://jonas.ow2.org
Bull, Architect of an Open World TM
http://www.bull.com=20


--------------070803030402030108050406
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi All,<br>
<blockquote cite="mid:[email protected]" type="cite">
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
Hi Celinio<br>
  <br>
Hmm... Where did you read that?<br>
  <br>
Anyhow, based on your description of the situation I guess your
workers.properties file is not good. I think:<br>
  <br>
  <blockquote>JkMount /toto*/* worker1<br>
  </blockquote>
  <br>
Has to be corrected with:<br>
  <br>
  <blockquote>JkMount /toto* worker1<br>
  </blockquote>
</blockquote>
You should add both<br>
<blockquote><tt>JkMount /toto worker1</tt><br>
  <tt>JkMount /toto/* worker1<br>
JkMountCopy Allou can<br>
  <br>
  </tt></blockquote>
BTW, did you take a look to the mod_jk's logs ? See
/etc/httpd/logs/mod_jk.log. If needed, you may enable the debug level.<br>
<br>
Regards<br>
<br>
<blockquote cite="mid:[email protected]" type="cite">
  <blockquote> </blockquote>
  <br>
or<br>
  <br>
  <blockquote>JkMount /toto/* worker1<br>
  </blockquote>
  <br>
Also, try visiting <span><a moz-do-not-send="true"
 class="moz-txt-link-freetext" href="http://blabla.com:80/toto/">http://blabla.com:80/toto/</a>
(with the final slash)</span><br>
  <br>
Thank you<br>
  <br>
  <pre class="moz-signature" cols="72">S. Ali Tokmen
<a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="http://ali.tokmen.com/">http://ali.tokmen.com/</a>

GSM (ch): +41 79 207 29 22 [Swisscom]
GSM (fr): +33 66 43 00 555 [Orange]
GSM (tr): +90 555 266 52 73 [Avea]

My AIM, ICQ, MSN Messenger and Yahoo IM
contact details are on <a moz-do-not-send="true"
 class="moz-txt-link-freetext" href="http://contact.ali.tokmen.com">http://contact.ali.tokmen.com</a></pre>
  <br>
On 2011/10/02 15:16, Celinio Fernandes wrote:
  <blockquote
 cite="mid:[email protected]"
 type="cite">
    <div
 style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: times 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 the URL <a moz-do-not-send="true"
 class="moz-txt-link-freetext" href="http://blabla.com:80/toto">http://blabla.com:80/toto</a>
(port 80) it does not work. I get a "Not found" error: "The requested
URL /toto/ was not found on this server."<br>
    <br>
The URL <a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="http://blabla.com:80/works">http://blabla.com:80/works</a>.&nbsp;&nbsp;
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>
&nbsp;&lt;Engine name="JOnAS" defaultHost="localhost" jvmRoute="worker1"&gt;<br>
&nbsp;<br>
&nbsp;<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="font-family: times new roman,new york,times,serif; font-size: 12pt;">
    <div
 style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font
 face="Arial" size="2">
    <hr size="1"><b><span style="font-weight: bold;">From:</span></b>
S. Ali Tokmen <a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
 href="mailto:[email protected]">&lt;[email protected]&gt;</a><br>
    <b><span style="font-weight: bold;">To:</span></b> <a
 moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:[email protected]">[email protected]</a><br>
    <b><span style="font-weight: bold;">Sent:</span></b> Sunday,
October 2, 2011 1:02 AM<br>
    <b><span style="font-weight: bold;">Subject:</span></b> [jonas] Re:
Re: Re: Jonas 5.2.1 and Apache mod_jk<br>
    </font><br>
    <div id="yiv613542751">
    <div> Hi Celinio<br>
    <br>
OK, well my personal recommendation is mod_proxy_ajp. It is officially
maintained by the httpd project and has a great number of stability and
performance improvements.<br>
    <br>
If you want to hit the AJP port, you should connect to the Apache httpd
server; i.e. not visit on the 9000 port but the 80 (or whatever other
Apache httpd) port.<br>
    <br>
Cheers<br>
    <br>
    <pre class="yiv613542751moz-signature">S. Ali Tokmen
<a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="http://ali.tokmen.com/">http://ali.tokmen.com/</a>

GSM (ch): +41 79 207 29 22 [Swisscom]
GSM (fr): +33 66 43 00 555 [Orange]
GSM (tr): +90 555 266 52 73 [Avea]

My AIM, ICQ, MSN Messenger and Yahoo IM
contact details are on <a moz-do-not-send="true"
 class="moz-txt-link-freetext" href="http://contact.ali.tokmen.com">http://contact.ali.tokmen.com</a></pre>
    <br>
On 2011/10/01 19:26, Celinio Fernandes wrote:
    <blockquote type="cite">
      <div
 style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: times new roman,new york,times,serif; font-size: 12pt;">
      <div><span>Hi Ali,</span></div>
      <div><span>there is no specific reason.</span></div>
      <div><br>
      <span></span></div>
      <div><span>Anyways, how can i make sure my webapp is using the
mod_jk connector ?</span></div>
      <div><span>I have installed and configured it in Apache and I
have also configured it in Jonas.</span></div>
      <div><span>I can also see the </span>AJP/JK connector configured
on port 8009 in the Jonas console admin.</div>
      <div><br>
      </div>
      <div>Now how do i make sure my request hits Apache first and that
Apache redirects it to Jonas then ?<br>
      </div>
      <div><br>
      </div>
      <div
 style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
      <div
 style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font
 face="Arial" size="2">
      <hr size="1"><b><span style="font-weight: bold;">From:</span></b>
S. Ali Tokmen <a moz-do-not-send="true" rel="nofollow"
 class="yiv613542751moz-txt-link-rfc2396E"
 ymailto="mailto:[email protected]" target="_blank"
 href="mailto:[email protected]">&lt;[email protected]&gt;</a><br>
      <b><span style="font-weight: bold;">To:</span></b> <a
 moz-do-not-send="true" rel="nofollow"
 class="yiv613542751moz-txt-link-abbreviated"
 ymailto="mailto:[email protected]" target="_blank"
 href="mailto:[email protected]">[email protected]</a><br>
      <b><span style="font-weight: bold;">Sent:</span></b> Saturday,
October 1, 2011 5:49 PM<br>
      <b><span style="font-weight: bold;">Subject:</span></b> [jonas]
Re: Jonas 5.2.1 and Apache mod_jk<br>
      </font><br>
      <div id="yiv613542751">
      <div> Hi Celinio<br>
      <br>
Is there a spacific reason why you're using mod_jk under Apache httpd
2.2 as opposed to the already embedded mod_proxy_ajp?<br>
      <br>
Thank you<br>
      <br>
      <pre class="yiv613542751moz-signature">S. Ali Tokmen
<a moz-do-not-send="true" rel="nofollow"
 class="yiv613542751moz-txt-link-freetext" target="_blank"
 href="http://ali.tokmen.com/">http://ali.tokmen.com/</a>

GSM (ch): +41 79 207 29 22 [Swisscom]
GSM (fr): +33 66 43 00 555 [Orange]
GSM (tr): +90 555 266 52 73 [Avea]

My AIM, ICQ, MSN Messenger and Yahoo IM
contact details are on <a moz-do-not-send="true" rel="nofollow"
 class="yiv613542751moz-txt-link-freetext" target="_blank"
 href="http://contact.ali.tokmen.com">http://contact.ali.tokmen.com</a></pre>
      <br>
On 2011/10/01 18:37, Celinio Fernandes wrote:
      <blockquote type="cite">
        <div
 style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: times new roman,new york,times,serif; font-size: 12pt;">
        <div>Hi,</div>
        <div>I am trying to interface my instance of Jonas 5.2.1 with
the connector mod_jk, in a Linux environment (CentOS).<br>
        </div>
        <div>I have added the module <a moz-do-not-send="true"
 rel="nofollow" target="_blank" href="http://mod_jk.so">mod_jk.so</a>
to /usr/lib64/httpd/modules.</div>
        <div><br>
        </div>
        <div>My version of Apache is 2.2</div>
        <div><br>
        </div>
        <div>I have configured /etc/httpd/conf/httpd.conf as the
following :</div>
        <div><br>
        </div>
        <div>LoadModule jk_module modules/mod_jk.so <br>
        <br>
&lt;IfModule jk_module&gt;<br>
# Ou trouver workers.properties ?<br>
JkWorkersFile /etc/httpd/conf/workers.properties<br>
# Ou mettre la memoire partagee de jk<br>
JkShmFile /etc/httpd/logs/mod_jk.shm<br>
# Ou mettre les logs jk<br>
JkLogFile /etc/httpd/logs/mod_jk.log<br>
# Positionner le niveau des logs jk [debug/error/info]<br>
JkLogLevel info<br>
# Selectionner lef ormat des logs pour le timestamp<br>
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "<br>
#Format des logs<br>
JkRequestLogFormat "%w %m %V %T"<br>
# Envoyer les contextes dont le nom commence par test : /toto* vers le
worker nomm&eacute; worker1<br>
JkMount /toto*/* worker1<br>
# On peut placer ici plusieurs JkMount si on a plusieurs contextes
traites<br>
# par des workers differents<br>
&lt;/IfModule&gt;</div>
        <div><br>
        </div>
        <div>I have added the following worker in
/etc/httpd/conf/worker.properties :</div>
        <div><br>
        </div>
        <div>&nbsp;#Define 1 worker<br>
&nbsp;worker.list=worker1<br>
&nbsp;<br>
&nbsp;#Set properties for worker1 (ajp13)<br>
&nbsp;worker.worker1.type=ajp13<br>
&nbsp;worker.worker1.host=blabla.com<br>
&nbsp;worker.worker1.port=8009<br>
        </div>
        <div><br>
        </div>
        <div>Under /home/test/jonas-full-5.2.1/conf/&nbsp; I have configured
both tomcat6-server.xml and tomcat7-server.xml (since I do not know
which one is used). I have uncommented the following line (changed port
9009 to 8009)<br>
        </div>
        <div><br>
        </div>
        <div>&nbsp; &lt;Connector port="8009" protocol="AJP/1.3"
redirectPort="9043" /&gt;</div>
        <div><br>
        </div>
        <div>My web app HTTP port in Jonas is configured to 9000.</div>
        <div>When I hit the URL <a moz-do-not-send="true"
 class="moz-txt-link-freetext" href="http://blabla.com:9000/toto">http://blabla.com:9000/toto</a>
I can see in the Jonas logs that Jonas is listening to that connector
but I have no idea whether Apache has handled the request or not.</div>
        <div><br>
        </div>
        <div>What can i do ? Am i missing something ?</div>
        <div>Thanks for helping.</div>
        </div>
      </blockquote>
      </div>
      </div>
      <br>
      <br>
      </div>
      </div>
      </div>
    </blockquote>
    </div>
    </div>
    <br>
    <br>
    </div>
    </div>
    </div>
  </blockquote>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 

----------------------------------------------------------------
Benoit Pelletier
<a class="moz-txt-link-freetext" href="http://jonas.ow2.org">http://jonas.ow2.org</a>
Bull, Architect of an Open World TM
<a class="moz-txt-link-freetext" href="http://www.bull.com">http://www.bull.com</a> 
</pre>
</body>
</html>

--------------070803030402030108050406--