Salut !!
J'essaye de configurer mon apache 2 avec tomcat 5 et mod_jk.
j'ai récupéré une binaire de mod_jk ici (http://archive.apache.org/dist/jakarta/tomcat-connectors/jk/v1.2.2/(...)
tomcat fonctionne parfaitement lorsqu'il sert seul sur le port 8080, mais dès que j'essaye de le connecter à apache, j'ai une erreure 500 internal error de apache.
voici mes fichiers de configuration:
/etc/httpd.conf
..
...
LoadModule jk_module modules/mod_jk.so
JkWorkersFile "/usr/local/tomcat/conf/workers.properties"
JkLogFile "/usr/local/apache/logs/mod_jk.log"
JkLogLevel debug
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkMount /servlet/* ajp13
JkMount /*.jsp ajp13
/usr/local/tomcat/conf/server.xml
/usr/local/tomcat/conf/workers.properties
workers.tomcat_home=/usr/local/tomcat
workers.java_home=/usr/local/java
ps=/
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=127.0.0.1
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
enfin, voici le fichier de log mod_jk.log
[Wed Jul 13 23:45:29 2005] [jk_uri_worker_map.c (172)]: Into jk_uri_worker_map_t::uri_worker_map_alloc
[Wed Jul 13 23:45:29 2005] [jk_uri_worker_map.c (375)]: Into jk_uri_worker_map_t::uri_worker_map_open
[Wed Jul 13 23:45:29 2005] [jk_uri_worker_map.c (396)]: jk_uri_worker_map_t::uri_worker_map_open, rule map size is 2
[Wed Jul 13 23:45:29 2005] [jk_uri_worker_map.c (321)]: Into jk_uri_worker_map_t::uri_worker_map_open, match rule /servlet/=ajp13 was added
[Wed Jul 13 23:45:29 2005] [jk_uri_worker_map.c (299)]: Into jk_uri_worker_map_t::uri_worker_map_open, suffix rule /.jsp=ajp13 was added
[Wed Jul 13 23:45:29 2005] [jk_uri_worker_map.c (408)]: Into jk_uri_worker_map_t::uri_worker_map_open, there are 2 rules
[Wed Jul 13 23:45:29 2005] [jk_uri_worker_map.c (422)]: jk_uri_worker_map_t::uri_worker_map_open, done
[Wed Jul 13 23:45:29 2005] [jk_worker.c (88)]: Into wc_open
[Wed Jul 13 23:45:29 2005] [jk_worker.c (222)]: Into build_worker_map, creating 1 workers
[Wed Jul 13 23:45:29 2005] [jk_worker.c (228)]: build_worker_map, creating worker ajp13
[Wed Jul 13 23:45:29 2005] [jk_worker.c (148)]: Into wc_create_worker
[Wed Jul 13 23:45:29 2005] [jk_worker.c (162)]: wc_create_worker, about to create instance ajp13 of ajp13
[Wed Jul 13 23:45:29 2005] [jk_ajp13_worker.c (108)]: Into ajp13_worker_factory
[Wed Jul 13 23:45:29 2005] [jk_worker.c (171)]: wc_create_worker, about to validate and init ajp13
[Wed Jul 13 23:45:29 2005] [jk_ajp_common.c (1219)]: Into jk_worker_t::validate
[Wed Jul 13 23:45:29 2005] [jk_ajp_common.c (1239)]: In jk_worker_t::validate for worker ajp13 contact is 127.0.0.1:8009
[Wed Jul 13 23:45:29 2005] [jk_ajp_common.c (1267)]: Into jk_worker_t::init
[Wed Jul 13 23:45:29 2005] [jk_ajp_common.c (1287)]: In jk_worker_t::init, setting socket timeout to 0
[Wed Jul 13 23:45:29 2005] [jk_worker.c (187)]: wc_create_worker, done
[Wed Jul 13 23:45:29 2005] [jk_worker.c (238)]: build_worker_map, removing old ajp13 worker
[Wed Jul 13 23:45:29 2005] [jk_worker.c (250)]: build_worker_map, done
[Wed Jul 13 23:45:29 2005] [jk_worker.c (111)]: wc_open, done 1
[Wed Jul 13 23:45:29 2005] [jk_worker.c (118)]: Into wc_close
[Wed Jul 13 23:45:29 2005] [jk_worker.c (199)]: close_workers got 1 workers to destroy
[Wed Jul 13 23:45:29 2005] [jk_worker.c (206)]: close_workers will destroy worker ajp13
[Wed Jul 13 23:45:29 2005] [jk_ajp_common.c (1324)]: Into jk_worker_t::destroy
[Wed Jul 13 23:45:29 2005] [jk_ajp_common.c (1331)]: Into jk_worker_t::destroy up to 1 endpoint to close
[Wed Jul 13 23:45:29 2005] [jk_worker.c (120)]: wc_close, done
[Wed Jul 13 23:45:29 2005] [jk_uri_worker_map.c (190)]: Into jk_uri_worker_map_t::uri_worker_map_free
[Wed Jul 13 23:45:29 2005] [jk_uri_worker_map.c (441)]: Into jk_uri_worker_map_t::uri_worker_map_close
[Wed Jul 13 23:45:29 2005] [jk_uri_worker_map.c (172)]: Into jk_uri_worker_map_t::uri_worker_map_alloc
[Wed Jul 13 23:45:29 2005] [jk_uri_worker_map.c (375)]: Into jk_uri_worker_map_t::uri_worker_map_open
[Wed Jul 13 23:45:29 2005] [jk_uri_worker_map.c (396)]: jk_uri_worker_map_t::uri_worker_map_open, rule map size is 2
[Wed Jul 13 23:45:29 2005] [jk_uri_worker_map.c (321)]: Into jk_uri_worker_map_t::uri_worker_map_open, match rule /servlet/=ajp13 was added
[Wed Jul 13 23:45:29 2005] [jk_uri_worker_map.c (299)]: Into jk_uri_worker_map_t::uri_worker_map_open, suffix rule /.jsp=ajp13 was added
[Wed Jul 13 23:45:29 2005] [jk_uri_worker_map.c (408)]: Into jk_uri_worker_map_t::uri_worker_map_open, there are 2 rules
[Wed Jul 13 23:45:29 2005] [jk_uri_worker_map.c (422)]: jk_uri_worker_map_t::uri_worker_map_open, done
[Wed Jul 13 23:45:29 2005] [jk_worker.c (88)]: Into wc_open
[Wed Jul 13 23:45:29 2005] [jk_worker.c (222)]: Into build_worker_map, creating 1 workers
[Wed Jul 13 23:45:29 2005] [jk_worker.c (228)]: build_worker_map, creating worker ajp13
[Wed Jul 13 23:45:29 2005] [jk_worker.c (148)]: Into wc_create_worker
[Wed Jul 13 23:45:29 2005] [jk_worker.c (162)]: wc_create_worker, about to create instance ajp13 of ajp13
[Wed Jul 13 23:45:29 2005] [jk_ajp13_worker.c (108)]: Into ajp13_worker_factory
[Wed Jul 13 23:45:29 2005] [jk_worker.c (171)]: wc_create_worker, about to validate and init ajp13
[Wed Jul 13 23:45:29 2005] [jk_ajp_common.c (1219)]: Into jk_worker_t::validate
[Wed Jul 13 23:45:29 2005] [jk_ajp_common.c (1239)]: In jk_worker_t::validate for worker ajp13 contact is 127.0.0.1:8009
[Wed Jul 13 23:45:29 2005] [jk_ajp_common.c (1267)]: Into jk_worker_t::init
[Wed Jul 13 23:45:29 2005] [jk_ajp_common.c (1287)]: In jk_worker_t::init, setting socket timeout to 0
[Wed Jul 13 23:45:29 2005] [jk_worker.c (187)]: wc_create_worker, done
[Wed Jul 13 23:45:29 2005] [jk_worker.c (238)]: build_worker_map, removing old ajp13 worker
[Wed Jul 13 23:45:29 2005] [jk_worker.c (250)]: build_worker_map, done
[Wed Jul 13 23:45:29 2005] [jk_worker.c (111)]: wc_open, done 1
[Wed Jul 13 23:46:06 2005] [jk_uri_worker_map.c (460)]: Into jk_uri_worker_map_t::map_uri_to_worker
[Wed Jul 13 23:46:06 2005] [jk_uri_worker_map.c (477)]: Attempting to map URI '/test.jsp'
[Wed Jul 13 23:46:06 2005] [jk_uri_worker_map.c (558)]: jk_uri_worker_map_t::map_uri_to_worker, Found a suffix match ajp13 -> *.jsp
[Wed Jul 13 23:46:06 2005] [mod_jk.c (1671)]: Into handler r->proxyreq=0 r->handler=jakarta-servlet r->notes=135845112 worker=ajp13
[Wed Jul 13 23:46:06 2005] [jk_worker.c (132)]: Into wc_get_worker_for_name ajp13
[Wed Jul 13 23:46:06 2005] [jk_worker.c (136)]: wc_get_worker_for_name, done found a worker
[Wed Jul 13 23:46:06 2005] [mod_jk.c (488)]: agsp=80 agsn=linux-server hostn=linux-server shostn=localhost cbsport=0 sport=0
[Wed Jul 13 23:46:06 2005] [jk_ajp_common.c (1404)]: Into jk_worker_t::get_endpoint
[Wed Jul 13 23:46:06 2005] [jk_ajp_common.c (1116)]: Into jk_endpoint_t::service
[Wed Jul 13 23:46:06 2005] [jk_ajp_common.c (295)]: Into ajp_marshal_into_msgb
[Wed Jul 13 23:46:06 2005] [jk_ajp_common.c (432)]: ajp_marshal_into_msgb - Done
[Wed Jul 13 23:46:06 2005] [jk_connect.c (158)]: Into jk_open_socket
[Wed Jul 13 23:46:06 2005] [jk_connect.c (165)]: jk_open_socket, try to connect socket = 10
[Wed Jul 13 23:46:06 2005] [jk_connect.c (174)]: jk_open_socket, after connect ret = 0
[Wed Jul 13 23:46:06 2005] [jk_connect.c (183)]: jk_open_socket, set TCP_NODELAY to on
[Wed Jul 13 23:46:06 2005] [jk_connect.c (200)]: jk_open_socket, return, sd = 10
[Wed Jul 13 23:46:06 2005] [jk_ajp_common.c (614)]: In jk_endpoint_t::ajp_connect_to_endpoint, connected sd = 10
[Wed Jul 13 23:46:06 2005] [jk_ajp_common.c (642)]: sending to ajp13 #411
[Wed Jul 13 23:46:06 2005] [jk_ajp_common.c (884)]: ajp_send_request 2: request body to send 0 - request body to resend 0
[Wed Jul 13 23:47:06 2005] [jk_ajp_common.c (681)]: ERROR: can't receive the response message from tomcat, network problems or tomcat is down.
[Wed Jul 13 23:47:06 2005] [jk_ajp_common.c (1050)]: Error reading reply from tomcat. Tomcat is down or network problems.
[Wed Jul 13 23:47:06 2005] [jk_ajp_common.c (1187)]: ERROR: Receiving from tomcat failed, recoverable operation. err=0
[Wed Jul 13 23:47:06 2005] [jk_connect.c (158)]: Into jk_open_socket
[Wed Jul 13 23:47:06 2005] [jk_connect.c (165)]: jk_open_socket, try to connect socket = 10
[Wed Jul 13 23:47:06 2005] [jk_connect.c (174)]: jk_open_socket, after connect ret = 0
[Wed Jul 13 23:47:06 2005] [jk_connect.c (183)]: jk_open_socket, set TCP_NODELAY to on
[Wed Jul 13 23:47:06 2005] [jk_connect.c (200)]: jk_open_socket, return, sd = 10
[Wed Jul 13 23:47:06 2005] [jk_ajp_common.c (614)]: In jk_endpoint_t::ajp_connect_to_endpoint, connected sd = 10
[Wed Jul 13 23:47:06 2005] [jk_ajp_common.c (642)]: sending to ajp13 #411
[Wed Jul 13 23:47:06 2005] [jk_ajp_common.c (884)]: ajp_send_request 2: request body to send 0 - request body to resend 0
[Wed Jul 13 23:48:06 2005] [jk_ajp_common.c (681)]: ERROR: can't receive the response message from tomcat, network problems or tomcat is down.
[Wed Jul 13 23:48:06 2005] [jk_ajp_common.c (1050)]: Error reading reply from tomcat. Tomcat is down or network problems.
[Wed Jul 13 23:48:06 2005] [jk_ajp_common.c (1187)]: ERROR: Receiving from tomcat failed, recoverable operation. err=1
[Wed Jul 13 23:48:06 2005] [jk_connect.c (158)]: Into jk_open_socket
[Wed Jul 13 23:48:06 2005] [jk_connect.c (165)]: jk_open_socket, try to connect socket = 10
[Wed Jul 13 23:48:06 2005] [jk_connect.c (174)]: jk_open_socket, after connect ret = 0
[Wed Jul 13 23:48:06 2005] [jk_connect.c (183)]: jk_open_socket, set TCP_NODELAY to on
[Wed Jul 13 23:48:06 2005] [jk_connect.c (200)]: jk_open_socket, return, sd = 10
[Wed Jul 13 23:48:06 2005] [jk_ajp_common.c (614)]: In jk_endpoint_t::ajp_connect_to_endpoint, connected sd = 10
[Wed Jul 13 23:48:06 2005] [jk_ajp_common.c (642)]: sending to ajp13 #411
[Wed Jul 13 23:48:06 2005] [jk_ajp_common.c (884)]: ajp_send_request 2: request body to send 0 - request body to resend 0
[Wed Jul 13 23:49:06 2005] [jk_ajp_common.c (681)]: ERROR: can't receive the response message from tomcat, network problems or tomcat is down.
[Wed Jul 13 23:49:06 2005] [jk_ajp_common.c (1050)]: Error reading reply from tomcat. Tomcat is down or network problems.
[Wed Jul 13 23:49:06 2005] [jk_ajp_common.c (1187)]: ERROR: Receiving from tomcat failed, recoverable operation. err=2
[Wed Jul 13 23:49:06 2005] [jk_ajp_common.c (1198)]: Error connecting to tomcat. Tomcat is probably not started or is listenning on the wrong port. Failed errno = 2
[Wed Jul 13 23:49:06 2005] [jk_ajp_common.c (1388)]: Into jk_endpoint_t::done, closing connection 0
[Wed Jul 13 23:49:06 2005] [jk_ajp_common.c (561)]: In jk_endpoint_t::ajp_close_endpoint
[Wed Jul 13 23:49:21 2005] [jk_uri_worker_map.c (460)]: Into jk_uri_worker_map_t::map_uri_to_worker
[Wed Jul 13 23:49:21 2005] [jk_uri_worker_map.c (477)]: Attempting to map URI '/favicon.ico'
[Wed Jul 13 23:49:21 2005] [jk_uri_worker_map.c (599)]: jk_uri_worker_map_t::map_uri_to_worker, done without a match
d'avance merci !
# Tu dois ajouter un dans ton server.xml
Posté par tontonflingueur . Évalué à 1.
Vérifier que tu as bien un Connector Coyote/JK2 AJP 1.3 sur le port 8009 (pour rester cohérent avec ton fichier workers.properties).
La déclaration est comme suit :
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8009" minProcessors="5" maxProcessors="75"
acceptCount="10" debug="0"/>
Normalement, l'entrée existe dans le fichier livré par défaut. Il suffit
de la décommenter - la déclaration dans ton cas ne sera probablement pas tout à fait la même car j'utilise Tomcat 4.
@+
[^] # Re: Tu dois ajouter un dans ton server.xml
Posté par gc (site web personnel) . Évalué à 2.
Tu utilises des options obsolètes de tomcat4.
Tu veux dire : minSpareThreads="5" maxThreads="75".
[^] # Re: Tu dois ajouter un dans ton server.xml
Posté par tontonflingueur . Évalué à 1.
Autre question tomcat est bien démarré ?
$CATALINA_HOME/bin/startup.sh (de mémoire). Donc dans ton cas ça doit être /usr/local/bin/startup.sh
@+
[^] # Re: Tu dois ajouter un dans ton server.xml
Posté par kameha . Évalué à 1.
d'apres ce que j'ai lu c'est la facon correcte de le configurer pour Tomcat 5...
<Server port="8005" shutdown="SHUTDOWN" debug="0">
<Service name="Tomcat-Apache">
<Connector className="org.apache.ajp.tomcat.Ajp13Connector"
port="8009" minProcessors="5" maxProcessors="75"
acceptCount="10" debug="0"/>
<Engine name="your_engine" debug="0" defaultHost="127.0.0.1">
<Host name="127.0.0.1" debug="0" appBase="webapps" unpackWARs="true">
<Context path="" docBase="/home/tomcat/webapps" debug="0" reloadable="true" />
</Host>
</Engine>
</Service>
</Server>
# Quelques conseils
Posté par Raoul Volfoni (site web personnel) . Évalué à 2.
Quelle est ta distrib linux? N'as-tu pas un frontend pour l'installation?
Dans la négative je te conseille plutot de récupérer les sources: http://www.apache.org/dist/jakarta/tomcat-connectors/jk/source/jk-1(...)
et de les compiler toi-même.
Ensuite jettes un oeil sur la doc de Tomcat car il me semble que tu as tout bon coté Apache mais que ton pb vient de ta config de Tomcat qui ne répond pas aux demandes ajp:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/ajp.html(...)
Bon courage.
[^] # Re: Quelques conseils
Posté par gc (site web personnel) . Évalué à 2.
Alors de deux choses l'une : soit tu l'as fait exprès, et c'est très drôle ; soit tu l'as pas fait exprès, et c'est très drôle mais pas pour la même raison.
[^] # Re: Quelques conseils
Posté par Raoul Volfoni (site web personnel) . Évalué à 2.
J'avais pourtant peur de faire du réchauffé, elle est vieille comme mes robes. ;)
[^] # Re: Quelques conseils
Posté par kameha . Évalué à 1.
warning: macro 'AM_PROG_LIBTOOL' not found in library
ensuite il continue un peu, puis des erreurs d'affichent...
tu parlais de frontend ??? c'est quoi ??
[^] # Re: Quelques conseils
Posté par Raoul Volfoni (site web personnel) . Évalué à 2.
portage, apt-get, urpmi, yast, etc.
Quelle est ta distrib linux? Pourquoi ne peux-tu pas utiliser le logiciel d'installation standard?
[^] # Re: Quelques conseils
Posté par kameha . Évalué à 1.
ma distrib est une Mandriva LE 2005 (Limited Edition)
j'ai mon Serveur Apache 2.0.54 qui tourne avec php5 et mysql 4.1.10
tout à été installé manuellement sur la machine et je souhaite rajouter le support des Servlet/JSP.
[^] # Re: Quelques conseils
Posté par kameha . Évalué à 1.
j'ai toujours besoin d'aide....
[^] # Re: Quelques conseils
Posté par tontonflingueur . Évalué à 1.
> [Wed Jul 13 23:49:06 2005] [jk_ajp_common.c (1198)]: Error
> connecting to tomcat. Tomcat is probably not started or is listenning > on the wrong port. Failed errno = 2
Le connecteur mod_jk s'attend à parler à tomcat sur le port 8009 sur 127.0.0.1. De deux choses l'une :
* ou tomcat est démarré et n'écoute pas sur le port 8009. Envoie-nous ton server.xml
* ou tomcat n'est pas démarré. Je suis désolé de rappeler des évidences, mais apache n'**embarque** pas tomcat comme il embarque php ou mod_perl. tomcat est un processus séparé que
tu dois démarrer à part.
Qu'est-ce qui se passe si tu fais un telnet 127.0.0.1 8009
@+
[^] # Re: Quelques conseils
Posté par kameha . Évalué à 1.
Bien sur, avant de lancer mon apache je lance tomcat $CATALINA_HOME/bin/startup.sh
lorsque je fais un telnet sur 127.0.0.1 8009, je me connecte correctement !
d'autres pistes ???
[^] # Re: Quelques conseils
Posté par tontonflingueur . Évalué à 1.
Qu'y a-t-il dans la log tomcat au sujet du connecteur en question ?
@+
Suivre le flux des commentaires
Note : les commentaires appartiennent à celles et ceux qui les ont postés. Nous n’en sommes pas responsables.