Re: Re: Re: Re: Re: Jonas 5.2.1 and Apache mod_jk
"S. Ali Tokmen" <[email protected]> Mon, 03 Oct 2011 07:49:42 +0300
| Newsgroups | gmane.comp.java.objectweb.jonas |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--------------080901060806080307090008
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi Celinio
Hmm... Where did you read that?
Anyhow, based on your description of the situation I guess your
workers.properties file is not good. I think:
JkMount /toto*/* worker1
Has to be corrected with:
JkMount /toto* worker1
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
> 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 work.
> I get a "Not found" error: "The requested URL /toto/ was not found on
> this server."
>
> The URL http://blabla.com:80/works. Same thing whether i use the IP
> or the hostname in worker's host definition:
> worker.worker1.host
>
> I made another change in both tomcat6-server.xml and
> 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
> 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 officially
> maintained by the httpd project and has a great number of stability
> and performance improvements.
>
> 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.
>
> 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
>> configured it in Jonas.
>> I can also see the AJP/JK connector configured on port 8009 in the
>> Jonas console admin.
>>
>> Now how do i make sure my request hits Apache first and that Apache
>> redirects it to Jonas then ?
>>
>> ----------------------------------------------------------------------=
--
>> *From:* S. Ali Tokmen <[email protected]>
>> <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 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
>>> connector mod_jk, in a Linux environment (CentOS).
>>> I have added the module mod_jk.so <http://mod_jk.so> to
>>> /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
>>> le worker nomm=E9 worker1
>>> JkMount /toto*/* worker1
>>> # On peut placer ici plusieurs JkMount si on a plusieurs contextes
>>> traites
>>> # par des workers differents
>>> </IfModule>
>>>
>>> I have added the following worker in /etc/httpd/conf/worker.propertie=
s :
>>>
>>> #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
>>> 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)
>>>
>>> <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
>>> Jonas logs that Jonas is listening to that connector but I have no
>>> idea whether Apache has handled the request or not.
>>>
>>> What can i do ? Am i missing something ?
>>> Thanks for helping.
>>
>>
>
>
--------------080901060806080307090008
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
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>
<br>
or<br>
<br>
<blockquote>JkMount /toto/* worker1<br>
</blockquote>
<br>
Also, try visiting <span><a 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 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 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:#000; background-color:#fff; 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 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 class="moz-txt-link-freetext" href="http://blabla.com:80/works">http://blabla.com:80/works</a>. 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="JOnAS" defaultHost="localhost"
jvmRoute="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="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 class="moz-txt-link-rfc2396E" href="mailto:[email protected]"><[email protected]></a><br>
<b><span style="font-weight: bold;">To:</span></b>
<a 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 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 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:#000;background-color:#fff;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]"><[email protected]></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:#000;background-color:#fff;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>
<IfModule jk_module><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é worker1<br>
JkMount /toto*/* worker1<br>
# On peut placer ici plusieurs JkMount
si on a plusieurs contextes traites<br>
# par des workers differents<br>
</IfModule></div>
<div><br>
</div>
<div>I have added the following worker
in /etc/httpd/conf/worker.properties :</div>
<div><br>
</div>
<div> #Define 1 worker<br>
worker.list=worker1<br>
<br>
#Set properties for worker1 (ajp13)<br>
worker.worker1.type=ajp13<br>
worker.worker1.host=blabla.com<br>
worker.worker1.port=8009<br>
</div>
<div><br>
</div>
<div>Under
/home/test/jonas-full-5.2.1/conf/ 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> <Connector port="8009"
protocol="AJP/1.3" redirectPort="9043"
/></div>
<div><br>
</div>
<div>My web app HTTP port in Jonas is
configured to 9000.</div>
<div>When I hit the URL
<a 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>
</body>
</html>
--------------080901060806080307090008--