->serveur apache 2 sur le port 80
->serveur tomcat 5.5 sur le port 8080 (as usual)
->connecteur JK 1.2 pour les transactions
Bas, voici les points importants de ma configuration de JK1.2 :
Citation :
// fichier httpd.conf
...
#
# JK Module Configuration
#
LoadModule jk_module modules/mod_jk.so
JkWorkersFile /usr/local/httpd/conf/workers.properties
JkLogFile /usr/local/httpd/logs/mod_jk.log
JkLogLevel info
JkShmFile /usr/local/httpd/logs/shm.log
...
...
...
<VirtualHost adresse_ip:80>
ServerAdmin email
DocumentRoot path/to/catalina/webapps/ROOT
ServerName monhost.ext (vais utiliser ça pour les données que je montrerai
CustomLog ...
ScriptAlias ... ...
###
# tomcat configuration
###
JkMount /*.jsp wxc
JkMount /*.do wxc
<Directory path/to/catalina/webapps>
###
# configuration htaccess
###
AllowOverride All
</Directory>
</VirtualHost>
...
#
# JK Module Configuration
#
LoadModule jk_module modules/mod_jk.so
JkWorkersFile /usr/local/httpd/conf/workers.properties
JkLogFile /usr/local/httpd/logs/mod_jk.log
JkLogLevel info
JkShmFile /usr/local/httpd/logs/shm.log
...
...
...
<VirtualHost adresse_ip:80>
ServerAdmin email
DocumentRoot path/to/catalina/webapps/ROOT
ServerName monhost.ext (vais utiliser ça pour les données que je montrerai
CustomLog ...
ScriptAlias ... ...
###
# tomcat configuration
###
JkMount /*.jsp wxc
JkMount /*.do wxc
<Directory path/to/catalina/webapps>
###
# configuration htaccess
###
AllowOverride All
</Directory>
</VirtualHost>
Et puisqu'il le faut :
Citation :
// fichier workers.properties
###
# workers.properties
###
###
# gestionnaire ajp13 pour les connexion entre apache et tomcat
###
# définition
workers.tomcat_home=$(CATALINA_HOME)
workers.java_home=$(JAVA_HOME)
ps=\
worker.list=wxc,balancer
worker.wxc.port=8009
worker.wxc.host=monhost.ext
worker.wxc.type=ajp13
worker.balancer.balance_worker=wxc
###
# workers.properties
###
###
# gestionnaire ajp13 pour les connexion entre apache et tomcat
###
# définition
workers.tomcat_home=$(CATALINA_HOME)
workers.java_home=$(JAVA_HOME)
ps=\
worker.list=wxc,balancer
worker.wxc.port=8009
worker.wxc.host=monhost.ext
worker.wxc.type=ajp13
worker.balancer.balance_worker=wxc
Voilà, cela me permet d'utiliser tomcat transmettant ses requêtes à apache.
J'ai mis un worker balancer comme conseillé pour utiliser plusieurs workers différents (car mon but est d'avoir deux virtualhosts travaillant avec apache).
Cependant (ça c'est la config actuelle), j'ai bien essayé d'avoir une deuxième worker, genre
Citation :
worker.list=wxc,wxd,balancer
...
worker.wxd.port=8010
worker.wxd.host=monhost2.ext
worker.wxd.type=ajp13
worker.balancer.balance_worker=wxc,wxd
...
worker.wxd.port=8010
worker.wxd.host=monhost2.ext
worker.wxd.type=ajp13
worker.balancer.balance_worker=wxc,wxd
puis utilisation logique de jk_mount et création du VirtualHost dans httpd.conf, et le nom dans la configuration de bind 9...
bon, bas au final, le VirtualHost marche bien niveau bind 9 et apache 2, car tout est accessible, mais si par contre j'essaie d'accéder à un fichier .jsp, bas j'ai un beau message 200 OK à l'écran :
Citation :
OK
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, email@monhost.ext and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/2.0.53 (Unix) PHP/5.0.4 mod_jk/1.2.10 Server at monhost.ext Port 80
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, email@monhost.ext and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/2.0.53 (Unix) PHP/5.0.4 mod_jk/1.2.10 Server at monhost.ext Port 80
Qu'est-ce qui peut coincer si j'ai parcouru la démarche habituelle, comme si je refaisais mon premier domaine... mais avec les paramètres différents correspondant à monhost.ext, et que j'ai ajouté le balancer ?