Apache mod_jk

Daniel Mróz beorn w magellan.pl
Pią, 22 Lis 2002, 14:26:44 CET


Czesc

   Mam maly problemik. Musze polaczyc Apache z Tomcatem. Apache
chodzi, Tomcat rowniez, z osobna jest wszystko OK. Teraz, biore modul
mod_jk (EAPI) ze strony indianca (w dystrybucji nie ma), tworze
workers.properties:

----------------------------------------------
workers.java_home = /usr/local
workers.tomcat_home = /home/users/tomcat

worker.list = ajp13

worker.ajp13.type = ajp13
worker.ajp13.host = localhost
worker.ajp13.port = 8009
----------------------------------------------

Konfiguruje Tomcata:

----------------------------------------------
<!-- 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"/>
----------------------------------------------

Konfiguruje Apache:

----------------------------------------------
LoadModule jk_module          lib/apache/mod_jk.so
AddModule mod_jk.c

JkWorkersFile /etc/httpd/workers.properties
JkLogFile /var/log/httpd/mod_jk.log
JkLogLevel debug
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions -ForwardKeySize +ForwardURICompat +ForwardDirectories
JkRequestLogFormat "%w %V %T"

JkMount /examples/servlets/* ajp13
---------------------------------------------

Odpalam Tomcata, ktory otwiera sobie port:

---------------------------------------------
[root w hanako root]# netstat -nl | grep 8009
tcp        0      0 0.0.0.0:8009            0.0.0.0:*   LISTEN
---------------------------------------------

Odpalam Apache, ktory nie zglasza zadnych bledow podczas ladowania
modulu (napewno jest ladowany), a jedyne co mam w logach, to w
mod_jk.log (wycialem timestampy):

---------------------------------------------
[jk_uri_worker_map.c (172)]: Into jk_uri_worker_map_t::uri_worker_map_alloc
[jk_uri_worker_map.c (375)]: Into jk_uri_worker_map_t::uri_worker_map_open
[jk_uri_worker_map.c (396)]: jk_uri_worker_map_t::uri_worker_map_open, rule map size is 1
[jk_uri_worker_map.c (321)]: Into jk_uri_worker_map_t::uri_worker_map_open, match rule /examples/servlets/=ajp13 was added
[jk_uri_worker_map.c (408)]: Into jk_uri_worker_map_t::uri_worker_map_open, there are 1 rules
[jk_uri_worker_map.c (422)]: jk_uri_worker_map_t::uri_worker_map_open, done
[jk_worker.c (88)]: Into wc_open
[jk_worker.c (222)]: Into build_worker_map, creating 1 workers
[jk_worker.c (228)]: build_worker_map, creating worker ajp12
[jk_worker.c (148)]: Into wc_create_worker
[jk_worker.c (162)]: wc_create_worker, about to create instance ajp12 of ajp12
[jk_ajp12_worker.c (283)]: Into ajp12_worker_factory
[jk_worker.c (171)]: wc_create_worker, about to validate and init ajp12
[jk_ajp12_worker.c (200)]: Into jk_worker_t::validate
[jk_ajp12_worker.c (212)]: In jk_worker_t::validate for worker ajp12 contact is localhost:8007
[jk_worker.c (187)]: wc_create_worker, done
[jk_worker.c (238)]: build_worker_map, removing old ajp12 worker
[jk_worker.c (250)]: build_worker_map, done
[jk_worker.c (111)]: wc_open, done 1
[jk_uri_worker_map.c (172)]: Into jk_uri_worker_map_t::uri_worker_map_alloc
[jk_uri_worker_map.c (375)]: Into jk_uri_worker_map_t::uri_worker_map_open
[jk_uri_worker_map.c (396)]: jk_uri_worker_map_t::uri_worker_map_open, rule map size is 1
[jk_uri_worker_map.c (321)]: Into jk_uri_worker_map_t::uri_worker_map_open, match rule
/examples/servlets/=ajp13 was added
[jk_uri_worker_map.c (408)]: Into jk_uri_worker_map_t::uri_worker_map_op
en, there are 1 rules
[jk_uri_worker_map.c (422)]: jk_uri_worker_map_t::uri_worker_map_open, done
[jk_worker.c (88)]: Into wc_open [Fri Nov 22 15:15:30 2002]  [jk_worker.c (222)]: Into
build_worker_map, creating 1 workers
[jk_worker.c (228)]: build_worker_map, creating worker ajp12
[jk_worker.c (148)]: Into wc_create_worker
[jk_worker.c (162)]: wc_create_worker, about to create instance ajp12 of ajp12
[jk_ajp12_worker.c (283)]: Into ajp12_worker_factory
[jk_worker.c (171)]: wc_create_worker, about to validate and init ajp12
[jk_ajp12_worker.c (200)]: Into jk_worker_t::validate
[jk_ajp12_worker.c (212)]: In jk_worker_t::validate for worker ajp12 contact is localhost:8007
[jk_worker.c (187)]: wc_create_worker, done
[jk_worker.c (238)]: build_worker_map, removing old ajp12 worker
[jk_worker.c (250)]: build_worker_map, done
[jk_worker.c (111)]: wc_open, done 1
-------------------------------------------------

(skad on do cholery bierze workera ajp12?)
Niestety, kazda proba wywolania jakiegokolwiek pliku z
http://127.0.0.1/examples/servlets/ konczy sie bledem 500 (Internal
server error), a Apache wogole nie nawiazuje zadnego polaczenia
Tomcatem wiszacym na 8009. Log z sesji w mod_jk.log:

-------------------------------------------------
[jk_uri_worker_map.c (460)]: Into jk_uri_worker_map_t::map_uri_to_worker
[jk_uri_worker_map.c (477)]: Attempting to map URI '/examples/servlets/'
[jk_uri_worker_map.c (502)]: jk_uri_worker_map_t::map_uri_to_worker, Found a context match
ajp13 -> /examples/servlets/
[jk_worker.c (132)]: Into wc_get_worker_for_name ajp13
[jk_worker.c (136)]: wc_get_worker_for_name, done did not found a worker
[jk_uri_worker_map.c (460)]: Into jk_uri_worker_map_t::map_uri_to_worker
[jk_uri_worker_map.c (477)]: Attempting to map URI '/errordocs/500.shtml'
[jk_uri_worker_map.c (599)]: jk_uri_worker_map_t::map_uri_to_worker, done without a match
[jk_uri_worker_map.c (460)]: Into jk_uri_worker_map_t::map_uri_to_worker
[jk_uri_worker_map.c (477)]: Attempting to map URI '/errordocs/HEADER.shtml'
[jk_uri_worker_map.c (599)]: jk_uri_worker_map_t::map_uri_to_worker, done without a match
[jk_uri_worker_map.c (460)]: Into jk_uri_worker_map_t::map_uri_to_worker
[jk_uri_worker_map.c (477)]: Attempting to map URI '/errordocs/FOOT.shtml'
[jk_uri_worker_map.c (599)]: jk_uri_worker_map_t::map_uri_to_worker, done without a match
------------------------------------------------

Teraz pytania:
- czy ktos z Was mial z czyms takim do czynienia?
- czy w PLD jest jakis sposob na polaczenie Apache z Tomcatem?
- dlaczego w PLD nie ma apache-mod_jk?


Dziekuje za pomoc i pozdrawiam
Beorn

-- 
----------------------------------------------------------------------
Daniel `Beorn' Mróz      <beorn w alpha.pl>       http://127.0.0.1/beorn
GCS/E d-(pu) s-:- a--@ C++++ UL++++$ P+++ L+++ E--- X W+>++ N+++ o? K-
w--- O M- V- PS PE- !Y PGP+ t- 5- R tv-- b+ DI++ D+++ G++ e h+ r--- y?
----------------------------------------------------------------------



Więcej informacji o liście dyskusyjnej pld-users-pl