PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : tomcat5.5 - debian sarge - mod_jk Konfiguration



netzmeister
25.04.07, 15:40
Hallo,

ich habe mir über apt-get install tomcat5.5 den Tomcat installiert.

leider erhalte ich bei automastischen Einrichten und bei Start einen Fehler:



Richte libservlet2.4-java ein (5.0.30-3) ...
Richte libcommons-el-java ein (1.0-3) ...
Richte libcommons-launcher-java ein (1.1-3) ...
Richte liblog4j1.2-java ein (1.2.13-2) ...
Richte libmx4j-java ein (2.1.1-4) ...
Richte libcommons-modeler-java ein (1.1-8) ...
Richte libtomcat5.5-java ein (5.5.20-2) ...
Richte tomcat5.5 ein (5.5.20-2) ...
Lege Systembenutzer »tomcat55« (UID 104) an ...
Lege neuen Benutzer »tomcat55« (UID 104) mit Gruppe »nogroup« an ...
Erstelle Home-Verzeichnis »/usr/share/tomcat5.5« nicht.
Installing /var/lib/tomcat5.5/conf/tomcat-users.xml.
Starting Tomcat servlet engine: tomcat5.5invoke-rc.d: initscript tomcat5.5, action "start" failed.
dpkg: Fehler beim Bearbeiten von tomcat5.5 (--configure):
Unterprozess post-installation script gab den Fehlerwert 1 zurück
Richte libgcj7-dev ein (4.1.1-20) ...
Richte gcj-4.1 ein (4.1.1-20) ...

Richte java-gcj-compat-dev ein (1.0.65-10) ...

Fehler traten auf beim Bearbeiten von:
tomcat5.5
E: Sub-process /usr/bin/dpkg returned an error code (1)
www1:~# mc

www1:~# dpkg --configure tomcat5.5
Richte tomcat5.5 ein (5.5.20-2) ...
Starting Tomcat servlet engine: tomcat5.5invoke-rc.d: initscript tomcat5.5, action "start" failed.
dpkg: Fehler beim Bearbeiten von tomcat5.5 (--configure):
Unterprozess post-installation script gab den Fehlerwert 1 zurück
Fehler traten auf beim Bearbeiten von:
tomcat5.5
www1:~#


Hat wer eine Idee?

Viele Grüße

Eicke

netzmeister
25.04.07, 15:53
Hallo,

mit:



# grep TOMCAT5_SECURITY /etc/default/tomcat5.5
TOMCAT5_SECURITY=no


geht es!

Viele Grüße

Eicke

netzmeister
25.04.07, 17:00
Hallo,

hat einer eine vernünftige Doku zu mod_jk?

Da finde ich nur uralte sachen, aber nichts zu Tomcat 5.5 und dem
passenden libapache2-mod-jk.

Kann mir das einer erklären?

Oder soll ich besser den mod_proxy nehmen?

Viele Grüße

Eicke

netzmeister
26.04.07, 09:59
Irgendwie bin ich da nich nicht weiter, ...

Hat das jemand am laufen?

Meine jk.conf sieht jetzt so aus:



JkworkersFile /etc/libapache2-mod-jk/workers.properties
JkShmFile /var/run/apache2/jk-runtime-status
JkLogFile /var/log/apache2/mod_jk.log
JkLogLevel info



hier die workers.properties




# workers.properties -
#
# This file is a simplified version of the workers.properties supplied
# with the upstream sources. The jni inprocess worker (not build in the
# debian package) section and the ajp12 (deprecated) section are removed.
#
# As a general note, the characters $( and ) are used internally to define
# macros. Do not use them in your own configuration!!!
#
# Whenever you see a set of lines such as:
# x=value
# y=$(x)\something
#
# the final value for y will be value\something
#
# Normaly all you will need to do is un-comment and modify the first three
# properties, i.e. workers.tomcat_home, workers.java_home and ps.
# Most of the configuration is derived from these.
#
# When you are done updating workers.tomcat_home, workers.java_home and ps
# you should have 3 workers configured:
#
# - An ajp13 worker that connects to localhost:8009
# - A load balancer worker
#
#

# OPTIONS ( very important for jni mode )

#
# 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=/var/lib/tomcat5.5

#
# 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/jvam/java-1.5.0-sun

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

#
#------ ADVANCED MODE ------------------------------------------------
#---------------------------------------------------------------------
#

#
#------ worker list ------------------------------------------
#---------------------------------------------------------------------
#
#
# The workers that your plugins should create and work with
#
worker.list=ajp13_worker

#
#------ ajp13_worker WORKER DEFINITION ------------------------------
#---------------------------------------------------------------------
#

#
# Defining a worker named ajp13_worker and of type ajp13
# Note that the name and the type do not have to match.
#
worker.ajp13_worker.port=8009
worker.ajp13_worker.host=localhost
worker.ajp13_worker.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_worker.lbfactor=1

#
# Specify the size of the open connection cache.
#worker.ajp13_worker.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=ajp13_worker



Irgendwie klappt der Connect von Apache auf dem Tomcat nicht!
Das Modul wird einwandfrei geladen, muß ich da am Apache noch was machen?

Viele Grüße

Eicke

marce
26.04.07, 10:06
was mir spontan einfällt: der entsprechende Connector ist im Tomcat definiert?

Ansonsten - wir verwenden hier meist mod_proxy, wenn überhaupt notwendig...


<böswillig>"Klappt nicht" ist allerdings keine Fehlermeldung, die mir der Apache oder der Tomcat jemals in ein Log geschrieben hätte...</böswillig>

netzmeister
26.04.07, 13:18
Hallo marce,

im Log findet sich nichts, was auf einen Fehler hindeutet.
Apache und Tomcat laufen einwandfrei. Der Connector ist
definiert.

Viele Grüße

Eicke

marce
26.04.07, 13:26
wie äussert sich denn dann der Fehler konkret?

Ich vermute mal der Aufruf lautet irgendwie "http://wasauchimmer/index.jsp" - was kommt dann zurück? Fehlerseite des Apache, des Tomcat, gar nichts, ...?

Und poste doch einfach mal das, was im Logfile steht - evtl. sowohl catalina.out, access, error und mod_jk-Log - dass so rein gar nichts drin steht kommt mir irgendwie komisch vor, ich kenne sowohl den Apache als auch den Tomcat als sehr gesprächig...

LKH
26.04.07, 13:45
Hi,

hast du überhaupt schon was an der httpd.conf (bzw. den eingebundenen Dateien) gemacht? Ich frage nur, weil du fragst, ob beim Apache noch was zu machen ist.

Das Modul hast du ja wohl geladen, hast du auch JkMount eingerichtet? So in der Art:


# Send servlet for context /examples to worker named ajp13worker
JkMount /examples/servlet/* ajp13_worker

Damit auch was geloggt wird (oder schreibt man das "gelogged"?), würde ich für das Modul ein Logfile erstellen lassen:


# Where to put jk logs
JkLogFile /var/log/httpd/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info

Alles gehört in die httpd.conf oder inkludiere eine Datei mit diesen Inhalten.

Läuft bei mir perfekt mit Tomcat 5.0 und 5.5.

Hoffe es hilft ...

netzmeister
26.04.07, 14:27
Hallo,

Module sind eingebunden:


Apache/2.2.3 (Debian) mod_jk/1.2.18 mod_python/3.2.10 Python/2.4.4 PHP/4.4.4-8+etch1 proxy_html/2.5 mod_perl/2.0.2 Perl/v5.8.8 Server at www1.server-server.de Port 80

Die Apachekonfig dieht hier jetzt so aus:



www1:/etc/apache2/sites-available# vi default
NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@localhost

# Send servlet for context /examples to worker named ajp13worker
JkMount /examples/servlet/* ajp13_worker



JkLogFile /var/log/apache2/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info

DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
# RedirectMatch ^/$ /apache2-default/
</Directory>


ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined
ServerSignature On



</VirtualHost>



Es kommt aber immer noch Std.-Startseite.

Viele Grüße

Eicke

marce
26.04.07, 14:50
Standard-Startseite von was?
Und welche URL rufst Du genau auf?

LKH
26.04.07, 14:51
Hi,

wenn du im Browser "http://localhost/examples/servlet/" eingibst, kommen dann die Servlet-Examples des Tomcat?

Wenn du die Standard-Startseite des Tomcat haben willst, musst die auch noch mounten mit


JkMount /* ajp13_worker

Ob das in der Praxis Sinn macht musst du entscheiden ...

netzmeister
26.04.07, 15:03
Hallo,

ich bekomme jetzt einen internal Server Error.

Im mod_jk.log steht jetzt:



[Do Apr 26 16:20:34 2007] [6516:26848] [info] jk_handler::mod_jk.c (1986): Could not find a worker for worker name=ajp13_worker


Das ist doch immerhin schon mal was! Ich rufe über den Browser auf. Startseite des Servers.

Ich habe im Tomcat Verzeichnis eine Anwendung, die in einem
Verzeichnis Namens "ROOT" lebt. Diese will ich über den Apachen
zugänglich machen.

Vielel Grüße

Eicke

LKH
26.04.07, 15:17
Hi,

wenn ich das richtig sehe fehlt dir auch noch die Angabe des workers-Files in der httpd.conf:


JkWorkersFile /etc/libapache2-mod-jk/workers.properties

Deswegen scheint er auch deinen Arbeiter nicht zu kennen - möglicherweise. ;)

netzmeister
26.04.07, 15:29
Hallo,

ich hatte die workers.properties nach /etc/apache2/conf.d verlinkt.
Da war wohl zuletzt der Fehler. Jetzt klappt es! Super vielen Dank. :D

Das workers.properties habe ich jetzt in der apache2.conf eingetragen.

Eicke