Tomcat/Apache/mod_jk : Erreur 404 avec http://localhost/examples/*
Bonjour à tous,
Je me lance dans la mise en place d'un serveur tomcat (6.0.26) pour jsp derrière un serveur apache (2.x+), le tout tournant sous Linux Mandriva. J'ai un peu galéré, d'autant que je ne sais pas encore déployer une application web, mais pour ce qui est du test serveur :
Mais :
Donc :
- Le relai semble bien se faire d'apache vers Tomcat : si j'invoque par exemple l'adresse /example/ au lieu d' /examples/ , je bascule de la page d'erreur tomcat à la page d'erreur apache. Je suppose donc que le worker fonctionne.
- Mais il y a un comportement hétérogène que je ne comprends pas au niveau des accès...
Donc soit Tomcat ne trouve (effectivement) pas la ressource..., soit plus probablement il y a une erreur de configuration générale.
Voici mon worker.properties (inspiré du worker.properties minimaliste)... :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| # workers.properties.minimal -
#
# This file provides minimal jk configuration properties needed to
# connect to Tomcat.
#
# The workers that jk should create and work with
#
worker.list=worker1,worker2,wlb,jkstatus
#
# Defining a worker named worker1 and of type ajp13
# Note that the name and the type do not have to match.
#
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=1
# Nouveau worker
worker.worker2.type=ajp13
worker.worker2.host=localhost
worker.worker2.port=8010
worker.worker2.lbfactor=1
#
# Defining a load balancer
#
worker.wlb.type=lb
worker.wlb.balance_workers=worker1
#
# Define status worker
#
worker.jkstatus.type=status |
... et ma configuration httpd.conf correspondante :
Citation:
## Ajout du 26/12/2010 pour intégration de Tomcat -- essai
LoadModule jk_module modules/mod_jk.so
# Where to find workers.properties
# Update this path to match your conf directory location (put workers.properties next to httpd.conf)
JkWorkersFile /etc/httpd/conf/workers.properties
# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
JkShmFile /var/log/httpd/mod_jk.shm
# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log next to access_log)
JkLogFile /var/log/httpd/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel error
# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# Send everything for context /examples to worker named worker1 (ajp13)
JkMount /examples/* worker1
JkMount /sample/* worker2
et un bout de mon serveur.xml :
Citation:
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->
<!-- Define a SSL HTTP/1.1 Connector on port 8443
This connector uses the JSSE configuration, when using APR, the
connector should be using the OpenSSL style configuration
described in the APR documentation -->
<!--
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<!-- Ajout pour worker 2 -->
<Connector port="8109" protocol="AJP/1.3" redirectPort="8443" />
<!-- 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).
Documentation at /docs/config/engine.html -->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine name="Catalina" defaultHost="localhost">
Toute piste est la bienvenue...
Merci et bonnes fêtes de fin d'année !