Apache - Tomcat - jk2

Gabriel Gajdos Gabriel.Gajdos na pal-inalfa.sk
Pátek Říjen 29 17:01:45 CEST 2004


Praveze to by nemal!

Filozofia prepojenia Apache & Tomcat je v tom, ze Apache bude servovat
staticky kontext a Tomcat dynamicky...
Prave konfig uri:/NetAdmin/*.jsp som chapal tak, ze tym je dane, co ide
Tomcatu a co zostane Apachovi...

Ale ked to nejde, tak to nejde... :-((
Ja by som to aspon skusil. ;-)

GG

-----Original Message-----
From: konference-bounces na java.cz [mailto:konference-bounces na java.cz] On
Behalf Of Straube, Radovana
Sent: Friday, October 29, 2004 4:38 PM
To: Java
Subject: RE: Apache - Tomcat - jk2

Alias som skusala nadefinovat, ale tymto smer cesta nevedie. Takto sa len
obide Tomcat. Apache potom priamo pristupuje k .jsp suborom ako k statickym
strankam.

Radka

-----Original Message-----
From: konference-bounces na java.cz [mailto:konference-bounces na java.cz]On
Behalf Of Gabriel Gajdos
Sent: Friday, October 29, 2004 4:34 PM
To: 'Java'
Subject: RE: Apache - Tomcat - jk2
Importance: Low


Mozno len  strielam (necital som detailne tento mail)...
Ked som pouzival takuto kombinaciu, tak som zvykol mat nastavene Alias na
strane Apache HTTPD....

Mal som asi v httpd.conf
    Alias /NetAdmin /mypath/NetAdmin
(tusim tak nejak, fakt teraz neviem presne)

Chapal som to tak, ze HTTP servuje klasicke stranky. Keby tam bolo
http://server/NetAdmin/Hocico.html, tak to bude servovat Apache a MUSI
poznat cestu k danej ceste. Ak ju nenajde, tak chlasi chybu.
...a potom dalsi konfig robi to, ze ak je to tebars *.jsp alebo
**/servlets/* tak to posunie Tomcatovi cez JK...

Skusali ste nadefinovat ten alias pre Apacha?

GG

-----Original Message-----
From: konference-bounces na java.cz [mailto:konference-bounces na java.cz] On
Behalf Of Straube, Radovana
Sent: Friday, October 29, 2004 11:12 AM
To: konference na java.cz
Subject: Apache - Tomcat - jk2

Dobry den,

mam problem s prepojenim Apache s Tomcatom cez jk2.
Pouzivam
- SuSE 9.1. 
- Apache  2.0.49
- Tomcat 4.1.30
- jdk 1.4.2_06
Subor mod_jk2.so mam nainstalovany priamo z originalnych instalaciek.

1. do /etc/apache2/httpd.conf som na koniec pridala

LoadModule jk2_module /usr/lib/apache2/mod_jk2.so <IfModule mod_jk2.c>
	JkSet config.file /etc/apache2/workers2.properties </IfModule>


2. /etc/apache2/workers2.properties obsahuje

[logger.file:0]
info=Where to put the mod_jk2 log.
file=/opt/tomcat/logs/jk2.shm
level=debug

[shm]
info=Scoreboard. Required for reconfiguration and status with multiprocess
servers file=/var/log/apache2/shm.log

# Define the communication channel
[channel.socket:localhost:8009]
port=8009
info=Ajp13 forwarding over socket
host=127.0.0.1

# define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009

# Map the NetAdmin webapp to the Web server uri space [uri:/NetAdmin/*]
worker=ajp13:localhost:8009
context=/NetAdmin

[uri:/NetAdmin/*.jsp]
worker=ajp13:localhost:8009
context=/NetAdmin


3. /opt/tomcat/conf/jk2.properties obsahuje

handler.list=channelSocket,request
shm.file=/opt/tomcat/logs/jk2.shm
channelSocket.port=8009


4. v subore /opt/tomcat/conf/server.xml mam zadefinovany jk2 connector

 <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
               port="8009" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="10" debug="0" connectionTimeout="20000"
               useURIValidationHack="false"
 
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>


Po restarte Apache aj Tomcatu, ked chcem pristupovat cez browser na moju
aplikaciu NetAdmin, nachadzajucu sa vo Tomcat adresari webapps, dostam
chybovu hlasku "Object not found!". V Apache error_log sa nachadzaju
nasledovne chybove hlasky:

[Fri Oct 29 10:36:30 2004] [error] jk2_init() Can't find child 16829 in none
of the 150 scoreboard slots [Fri Oct 29 10:36:33 2004] [error] [client
212.18.14.202] File does not exist: /srv/www/htdocs/NetAdmin

Nechapem, preco sa Apache nespoji s Tomcatom, ale hlada moju aplikaciu
NetAdmin vo svojom standardnom adresari.

Googlovanie mi vobec nepomohlo. Ma prosim niekto predstavu kde robim chybu?

Radka


________ Information from NOD32 ________ This message was checked by NOD32
Antivirus System for Linux Mail Server.
  part000.txt - is OK
http://www.nod32.com





________ Information from NOD32 ________ This message was checked by NOD32
Antivirus System for Linux Mail Server.
  part000.txt - is OK
http://www.nod32.com


________ Information from NOD32 ________ This message was checked by NOD32
Antivirus System for Linux Mail Server.
  part000.txt - is OK
http://www.nod32.com





________ Information from NOD32 ________
This message was checked by NOD32 Antivirus System for Linux Mail Server.
  part000.txt - is OK
http://www.nod32.com


Další informace o konferenci Konference