<!-- Server Configuration File for Tomcat 4.1 on Debian
You can find a more complete example in
/usr/share/doc/tomcat4/examples/
-->
<!-- Note that component elements are nested corresponding to their
parent-child relationships with each other -->
<!-- A "Server" is a singleton element that represents the entire JVM,
which may contain one or more "Service" instances. The Server
listens for a shutdown command on the indicated port.
Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" or "Loggers" at this level.
-->
<Server port="8005" shutdown="SHUTDOWN" debug="0">
<!-- Uncomment these entries to enable JMX MBeans support -->
<Listener
className="org.apache.catalina.mbeans.ServerLifecycleListener"
debug="0"/>
<Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
debug="0"/>
<!-- Global JNDI resources -->
<GlobalNamingResources>
<!-- Test entry for demonstration purposes -->
<Environment name="simpleValue" type="java.lang.Integer"
value="30"/>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users -->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved">
</Resource>
<ResourceParams name="UserDatabase">
<parameter>
<name>factory</name>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
</parameter>
<parameter>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</parameter>
</ResourceParams>
</GlobalNamingResources>
<!-- A "Service" is a collection of one or more "Connectors" that
share
a single "Container" (and therefore the web applications
visible
within that Container). Normally, that Container is an
"Engine",
but this is not required.
Note: A "Service" is not itself a "Container", so you may not
define subcomponents such as "Valves" or "Loggers" at this
level.
-->
<!-- Define the Tomcat Stand-Alone Service -->
<Service name="Tomcat-Standalone">
<!-- A "Connector" represents an endpoint by which requests are
received
and responses are returned. Each Connector passes requests
on to the
associated "Container" (normally an Engine) for processing.
-->
<!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8180 -->
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8180" minProcessors="5" maxProcessors="75"
enableLookups="true" acceptCount="10" debug="0"
connectionTimeout="20000" useURIValidationHack="false"
/>
<!-- 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" acceptCount="10" debug="0"
connectionTimeout="20000" useURIValidationHack="false"
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>
<!-- An Engine represents the entry point (within Catalina) that
processes
every request. The Engine implementation for Tomcat stand
alone
analyzes the HTTP headers included with the request, and
passes them
on to the appropriate Host (virtual host). -->
<!-- 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_" suffix=".log" timestamp="true"/>
<!-- Because this Realm is here, an instance will be shared
globally -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
debug="0" resourceName="UserDatabase"/>
<!-- Define the default virtual host -->
<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<!-- Logger shared by all Contexts related to this virtual
host. -->
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="localhost_" suffix=".log"
timestamp="true"/>
</Host>
</Engine>
</Service>
<!-- Define an Apache-Connector Service -->
<Service name="Tomcat-Apache">
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8008" minProcessors="5" maxProcessors="75"
enableLookups="true" appbase="webapps"
acceptCount="10" debug="0"/>
<Engine className="org.apache.catalina.connector.warp.WarpEngine"
name="Apache" debug="0">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="mod_webapp_" suffix=".log" timestamp="true"/>
<Realm className="org.apache.catalina.realm.MemoryRealm" />
</Engine>
</Service>
</Server>
worker.properties sieht so aus:
# Tomcat and Java configuration
#
workers.tomcat_home=/usr/share/tomcat4
workers.java_home=/usr/local/j2sdk1.4.1_01
ps=/
worker.list=local
# Definition for local worker using AJP 1.3
#
worker.local.type=ajp13
worker.local.host=localhost
worker.local.port=8008
In der httpd.conf steht folgender Eintrag:
# mod_jk configuration
JkWorkersFile /etc/libapache-mod-jk/workers.properties
JkLogFile /var/log/apache/mod_jk.log
JkLogLevel info
Alias /tomcat-examples /usr/share/tomcat4/server/webapps/examples
<Directory "/usr/share/tomcat4/server/webapps/examples">
Options Indexes FollowSymLinks
</Directory>
JkMount /tomcat-examples/servlets/* local
JkMount /tomcat-examples/jsp*.jsp local
<Location "/tomcat-examples/WEB-INF/">
AllowOverride None
Deny from all
</Location>
<Location "/tomcat-examples/META-INF/">
AllowOverride None
Deny from all
</Location>
In /etc/apache/modules.conf ist mod_jk eingebunden.
Gruß
Thomas Blum
> Ich habe nun das Problem, daß der Server wohl erreichbar ist, aber
> keinen Java-Code ausführt, sondern ihn einfach als Text ausgibt.
Um was für "Java-Code" handelt es sich? Um eine JSP? Fängt deren Name
auch mit "jsp" an? Schließlich hast du (wenn ich mich in dem Wust nicht
etwas übersehen habe), ja nur ein Mapping
> JkMount /tomcat-examples/jsp*.jsp local
Da solltest du dann evtl. lieber
JkMount /tomcat-examples/*.jsp local
stehen haben.
Ansonsten müsstest du halt nochmal etwas detaillierter dein Problem
erklären, und evtl. mal schreiben was für eine URL du denn da aufrufst.
Nico
>Thomas Blum wrote:
>
>> Ich habe nun das Problem, daß der Server wohl erreichbar ist, aber
>> keinen Java-Code ausführt, sondern ihn einfach als Text ausgibt.
>
>Um was für "Java-Code" handelt es sich? Um eine JSP? Fängt deren Name
>auch mit "jsp" an? Schließlich hast du (wenn ich mich in dem Wust nicht
>etwas übersehen habe), ja nur ein Mapping
>
>> JkMount /tomcat-examples/jsp*.jsp local
>
>Da solltest du dann evtl. lieber
>
>JkMount /tomcat-examples/*.jsp local
>
>stehen haben.
Hi,
ich habe obigen Eintrag geändert, da fehlte ein slash, jetzt steht da:
JkMount /tomcat-examples/jsp/*.jsp
Jetzt wird mir nicht mehr der Code-Teil desQuelltextes der JSP-Seite
angezeigt, sondern ich bekomme eine leere Seite, wenn ich z. B.
http://server/tomcat-examples/jsp/numguess.jsp
aufrufe (es handelt sich um die tomcat beiliegenden Beispiele).
Gleiches gilt, wenn ich ein Servlet aus tomcat-examples/servlets/
aufrufe.
Gruß
T. Blum
Welche Fehlermeldungen gibt es im Error.log der beiden Server?
regards, Kim
--
---===### http://www.tuxfutter.de ###===---
Das Wiki für den Umstieg von Windows nach Linux
*******************************************************
Wer aufhört, sich zu verbessern, hört auf, gut zu sein!