PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Apache + Tomcat + mod_jk



make
12.06.04, 13:44
Hallo zusammen!

Ich benutze Debian Woody und möchte Tomcat 4.0 mit Apache 1.3 über mod_jk kombinieren. Das haben hier ja sicher schon einige probiert. Allerdings funktioniert es bei mir nicht richtig. Hier mal meine configs:

server.xml

<!-- Server Configuration File for Tomcat 4.0 on Debian
You can find more complete examples in /usr/share/doc/tomcat4/exmaples/.
-->

<Server port="8005" shutdown="SHUTDOWN" debug="0">

<!-- Define the Tomcat Stand-Alone Service -->
<Service name="Tomcat-Standalone">

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8009" minProcessors="5" maxProcessors="75"
acceptCount="10" debug="0" address="127.0.0.1"/>
<!-- Define the top level container in our container hierarchy -->
<Engine name="Standalone" defaultHost="localhost" debug="0">

<!-- Global logger unless overridden at lower levels -->
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="catalina_log." suffix=".txt"
timestamp="true"/>

<!-- Because this Realm is here, an instance will be shared globally -->
<Realm className="org.apache.catalina.realm.MemoryRealm" />

<!-- Define the default virtual host -->
<Host name="forum.domain.de" debug="0" appBase="webapps" unpackWARs="false">

<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common" />

<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="localhost_log." suffix=".txt"
timestamp="true"/>

<Context path="" docBase="/forum"
debug="0" privileged="true"/>

</Host>

</Engine>

</Service>

</Server>


worker.properties
# workers.tomcat_home should point to the location where you
# installed tomcat. This is where you have your conf, webapps and lib
# directories.
#

workers.tomcat_home=/usr/share/tomcat4
#
# workers.java_home should point to your Java installation. Normally
# you should have a bin and lib directories beneath it.
#
workers.java_home=/usr/lib/j2se/1.3/

#
# You should configure your environment slash... ps=\ on NT and / on UNIX
# and maybe something different elsewhere.
#
ps=/


#------ DEFAULT ajp13 WORKER DEFINITION ------------------------------
#---------------------------------------------------------------------
#

#
# Defining a worker named ajp13 and of type ajp13
# Note that the name and the type do not have to match.
#
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
# ----> lbfactor must be > 0
# ----> Low lbfactor means less work done by the worker.
worker.ajp13.lbfactor=1

#
# Specify the size of the open connection cache.
#worker.ajp13.cachesize

#
#------ DEFAULT LOAD BALANCER WORKER DEFINITION ----------------------
#---------------------------------------------------------------------
#

#
# The loadbalancer (type lb) workers perform wighted round-robin
# load balancing with sticky sessions.
# Note:
# ----> If a worker dies, the load balancer will check its state
# once in a while. Until then all work is redirected to peer
# workers.
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp12, ajp13


#
#------ CLASSPATH DEFINITION -----------------------------------------
#---------------------------------------------------------------------
#

#
# Additional class path components.
#
worker.inprocess.class_path=$(workers.tomcat_home) $(ps)lib$(ps)tomcat.jar

#
# Setting the command line for tomcat.
# Note: The cmd_line string may not contain spaces.
#
worker.inprocess.cmd_line=start


Auszug httpd.conf
NameVirtualHost *

<VirtualHost *>
DocumentRoot /var/lib/tomcat4/webapps/forum
ServerName forum.domain.de
JkMount /*.jsp ajp13
</VirtualHost>

#*****************************
#Automatisch durch Debian konfiguriert*
#*****************************

<IfModule mod_jk.c>
JkWorkersFile /etc/tomcat/jk/workers.properties
Include /var/lib/tomcat/conf/mod_jk.conf
</IfModule>



So das waren die configs. Wenn ich allerdings versuche, auf die Seite zuzugreifen, kommt folgende Fehlermeldung:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.


Weis jemand, wo der Fehler in meiner Konfiguration ist?

himbeere
13.06.04, 00:09
Hallo

Ich habe jetzt ehrlich gesagt keine Lust, Deine Konfigfiles nach Fehlern zu durchforsten. Poste doch mal die Fehlermeldungen von Apache und Tomcat.

Gruß
Thomas

make
13.06.04, 20:51
Hmm..genau das ist das Problem. Ich kriege eigenlich keine Fehler in den Logfiles. Ausser eben dem Fehler im Browser:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.


Der Fehler taucht allerdings erst auf, sobald eine JSP-Seite aufgerufen werden soll. So lange es sich um HTML handelt (auch im gleichen Tomcat-Context wie eine JSP-Seite) wird die Seite normal angezeigt.

temir
14.06.04, 11:03
schau' mal in $TOMCAT_HOME/logs/, bzw. $CATALINA_HOME/logs (das gleiche).

make
14.06.04, 19:22
Genau dort habe ich gesucht, habe aber in den Logs nichts gefunenden. Beim Apache ebenso. Ist wohl einfach ein Problem der Verbindung zwischen den beiden, also mod_jk.

make
15.06.04, 15:32
Hat niemand eine Idee?

temir
16.06.04, 08:38
dass in den Logs nix auftaucht - kann nicht sein. Mind. beim Start des Tomcat
sollte man sehen (lesen), dass die JSP-Engine gestartet oder nicht gestartet ist.
Beim fehlen, und einem Zugriff auf JSP sollte es eine Exception geben.

`kk
16.06.04, 14:25
apachectl configtest

make
16.06.04, 17:19
Also, apachectl sagt, config sei ok.


Nun zu den Logfiles:

catalina.out
-----------
Using CATALINA_BASE: /usr/share/tomcat4
Using CATALINA_HOME: /usr/share/tomcat4
Using CATALINA_TMPDIR: /usr/share/tomcat4/temp
Using JAVA_HOME: /usr/lib/j2se/1.3
Using Security Manager
Process ID of spawned JVM: 13302
Starting service Tomcat-Standalone
Apache Tomcat/4.0.3



catalina_log
-----------
2004-06-16 18:10:07 Ajp13Processor[8009][4] Stopping background thread
2004-06-16 18:10:07 Ajp13Processor[8009][3] Stopping background thread
2004-06-16 18:10:07 Ajp13Processor[8009][2] Stopping background thread
2004-06-16 18:10:07 Ajp13Processor[8009][1] Stopping background thread
2004-06-16 18:10:07 Ajp13Processor[8009][0] Stopping background thread
2004-06-16 18:10:07 Ajp13Connector[8009] Stopping background thread
2004-06-16 18:10:11 Ajp13Connector[8009] Opening server socket on all host IP addresses
2004-06-16 18:10:11 Ajp13Connector[8009] Starting background thread
2004-06-16 18:10:11 Ajp13Processor[8009][0] Starting background thread
2004-06-16 18:10:11 Ajp13Processor[8009][1] Starting background thread
2004-06-16 18:10:11 Ajp13Processor[8009][2] Starting background thread
2004-06-16 18:10:11 Ajp13Processor[8009][3] Starting background thread
2004-06-16 18:10:11 Ajp13Processor[8009][4] Starting background thread


und noch von der applikation
---------------------------
2004-06-16 18:10:10 WebappLoader[]: Deploying class repositories to work directory /usr/share/tomcat4/work/forum.domain.de/_
2004-06-16 18:10:10 StandardManager[]: Seeding random number generator class java.security.SecureRandom
2004-06-16 18:10:10 StandardManager[]: Seeding of random number generator has been completed
2004-06-16 18:10:10 StandardWrapper[:default]: Loading container servlet default
2004-06-16 18:10:10 default: init
2004-06-16 18:10:10 StandardWrapper[:invoker]: Loading container servlet invoker
2004-06-16 18:10:10 invoker: init
2004-06-16 18:10:10 jsp: init
2004-06-16 18:10:11 StandardHost: Installing web application at context path /forum from URL file:/var/lib/tomcat4/webapps/forum
2004-06-16 18:10:11 WebappLoader: Deploying class repositories to work directory /usr/share/tomcat4/work/forum.domain.de/forum
2004-06-16 18:10:11 StandardManager[/forum]: Seeding random number generator class java.security.SecureRandom
2004-06-16 18:10:11 StandardManager[/forum]: Seeding of random number generator has been completed
2004-06-16 18:10:11 StandardWrapper[/forum:default]: Loading container servlet default
2004-06-16 18:10:11 default: init
2004-06-16 18:10:11 StandardWrapper[/forum:invoker]: Loading container servlet invoker
2004-06-16 18:10:11 invoker: init
2004-06-16 18:10:11 jsp: init

make
25.06.04, 10:44
So ich bin jetzt einen Schritt weiter..das Problem ist zwar nicht gelöst, aber ich konnte für mod_jk ein Log einrichten und in dem Logfile hab ich jetzt einen Fehler gefunden.

[Fri Jun 25 11:35:43 2004] [jk_uri_worker_map.c (159)]: Into jk_uri_worker_map_t::uri_worker_map_alloc
[Fri Jun 25 11:35:43 2004] [jk_uri_worker_map.c (199)]: Into jk_uri_worker_map_t::uri_worker_map_open
[Fri Jun 25 11:35:43 2004] [jk_uri_worker_map.c (217)]: jk_uri_worker_map_t::uri_worker_map_open, rule map size is 0
[Fri Jun 25 11:35:43 2004] [jk_uri_worker_map.c (324)]: jk_uri_worker_map_t::uri_worker_map_open, done
[Fri Jun 25 11:35:43 2004] [jk_worker.c (82)]: Into wc_open
[Fri Jun 25 11:35:43 2004] [jk_worker.c (207)]: Into build_worker_map, creating 1 workers
[Fri Jun 25 11:35:43 2004] [jk_worker.c (213)]: build_worker_map, creating worker ajp13
[Fri Jun 25 11:35:43 2004] [jk_worker.c (138)]: Into wc_create_worker
[Fri Jun 25 11:35:43 2004] [jk_worker.c (152)]: wc_create_worker, about to create instance ajp13 of ajp13
[Fri Jun 25 11:35:43 2004] [jk_ajp13_worker.c (922)]: Into ajp13_worker_factory
[Fri Jun 25 11:35:43 2004] [jk_worker.c (161)]: wc_create_worker, about to validate and init ajp13
[Fri Jun 25 11:35:43 2004] [jk_ajp13_worker.c (443)]: Into jk_worker_t::validate
[Fri Jun 25 11:35:43 2004] [jk_ajp13_worker.c (456)]: In jk_worker_t::validate for worker ajp13 contact is localhost:8009
[Fri Jun 25 11:35:43 2004] [jk_ajp13_worker.c (482)]: Into jk_worker_t::init
[Fri Jun 25 11:35:43 2004] [jk_worker.c (177)]: wc_create_worker, done
[Fri Jun 25 11:35:43 2004] [jk_worker.c (223)]: build_worker_map, removing old ajp13 worker
[Fri Jun 25 11:35:43 2004] [jk_worker.c (235)]: build_worker_map, done
[Fri Jun 25 11:35:43 2004] [jk_worker.c (102)]: wc_open, done
[Fri Jun 25 11:35:44 2004] [jk_uri_worker_map.c (159)]: Into jk_uri_worker_map_t::uri_worker_map_alloc
[Fri Jun 25 11:35:44 2004] [jk_uri_worker_map.c (199)]: Into jk_uri_worker_map_t::uri_worker_map_open
[Fri Jun 25 11:35:44 2004] [jk_uri_worker_map.c (217)]: jk_uri_worker_map_t::uri_worker_map_open, rule map size is 0
[Fri Jun 25 11:35:44 2004] [jk_uri_worker_map.c (324)]: jk_uri_worker_map_t::uri_worker_map_open, done
[Fri Jun 25 11:35:44 2004] [jk_worker.c (82)]: Into wc_open
[Fri Jun 25 11:35:44 2004] [jk_worker.c (207)]: Into build_worker_map, creating 1 workers
[Fri Jun 25 11:35:44 2004] [jk_worker.c (213)]: build_worker_map, creating worker ajp13
[Fri Jun 25 11:35:44 2004] [jk_worker.c (138)]: Into wc_create_worker
[Fri Jun 25 11:35:44 2004] [jk_worker.c (152)]: wc_create_worker, about to create instance ajp13 of ajp13
[Fri Jun 25 11:35:44 2004] [jk_ajp13_worker.c (922)]: Into ajp13_worker_factory
[Fri Jun 25 11:35:44 2004] [jk_worker.c (161)]: wc_create_worker, about to validate and init ajp13
[Fri Jun 25 11:35:44 2004] [jk_ajp13_worker.c (443)]: Into jk_worker_t::validate
[Fri Jun 25 11:35:44 2004] [jk_ajp13_worker.c (456)]: In jk_worker_t::validate for worker ajp13 contact is localhost:8009
[Fri Jun 25 11:35:44 2004] [jk_ajp13_worker.c (482)]: Into jk_worker_t::init
[Fri Jun 25 11:35:44 2004] [jk_worker.c (177)]: wc_create_worker, done
[Fri Jun 25 11:35:44 2004] [jk_worker.c (223)]: build_worker_map, removing old ajp13 worker
[Fri Jun 25 11:35:44 2004] [jk_worker.c (235)]: build_worker_map, done
[Fri Jun 25 11:35:44 2004] [jk_worker.c (102)]: wc_open, done
[Fri Jun 25 11:35:50 2004] [jk_uri_worker_map.c (351)]: Into jk_uri_worker_map_t::map_uri_to_worker
[Fri Jun 25 11:35:50 2004] [jk_uri_worker_map.c (368)]: Attempting to map URI '/'
[Fri Jun 25 11:35:50 2004] [jk_uri_worker_map.c (391)]: jk_uri_worker_map_t::map_uri_to_worker, Found a context match .jsp -> /
[Fri Jun 25 11:35:50 2004] [jk_worker.c (123)]: Into wc_get_worker_for_name .jsp
[Fri Jun 25 11:35:50 2004] [jk_worker.c (127)]: wc_get_worker_for_name, done did not found a worker


Ich werde aber nicht schlau aus diesem Fehler:
[Fri Jun 25 11:35:50 2004] [jk_worker.c (127)]: wc_get_worker_for_name, done did not found a worker

himbeere
25.06.04, 19:58
Okay. Ich empfehle Dir erstmal zu versuchen mod_jk ohne jeden Schnickschnack an den Start zu bringen. Die in tomcat laufenden Webapps kannst Du dann konfigurieren, wenn mod_jk grundsätzlich läuft. Schau Dir doch mal: http://forums.gentoo.org/viewtopic.php?t=95184&highlight=modjk an. Wenns dann soweit läuft, kannst Du Dich daran machen, alles so anzupassen wie von Dir gewollt. Nebenbei, was sind das für eigenartige Verzeichnisse? Welche Distri macht das denn so?

workers.tomcat_home=/usr/share/tomcat4
workers.java_home=/usr/lib/j2se/1.3/

Sehr schräg.

Gruß
Thomas

make
26.06.04, 12:03
Das ist Debian ;-)

Ok, ich werd mir das mal anschauen...

make
29.06.04, 09:35
Nun, ich habe das ganze jetzt halt mit Suse gemacht, da wars eigentlich kein Problem...