[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: tomcat6, apache2 e mod_jk.



Il giorno 24 agosto 2009 11.59, Mauro<mrsanna1@gmail.com> ha scritto:
> 2009/8/24 Enrico La Cava <enrico.lacava@gmail.com>:
>
>> Con con ajp invece tutto si risolve in pochissime righe. Se vuoi posso
>> anche postarti l'esempio che uso io.
>
> Mi faresti un favore, grazie. :-)
>

Argh, ho venduto la pelle del cinghiale...

Io uso anche il balancing quindi ho in apache2.conf questo:
------------

ProxyPass /clover balancer://cluster/clover stickysession=JSESSIONID

<Proxy balancer://cluster>
BalancerMember ajp://localhost:8009 route=tomcat1
BalancerMember ajp://localhost:7009 route=tomcat2
Allow from all
</Proxy>

-----------

Dove /clover è la directory che linkerò

Poi in server.xml ho inserito questo:

<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat1">

Oltre, ovviamente, ai settaggi delle porte 8009 e 7009 che sono
assolutamente arbitrari.

Mi raccomando la variabile jvmRoute è l'identificatore univoco
dell'installazione di tomcat, puoi inserirci ciò che vuoi, basta che
corrisponda :D

*Non* ho provato ma credo che se elimini una delle due stringe
BalancerMember ti funziona uguale :D

Un equivalente con mod_jk per agganciare solo una installazione di
tomcat è questo:

Include /etc/apache2/sites-enabled/
  # Load mod_jk module
  # Update this path to match your modules location
  LoadModule    jk_module  mod_jk.so
  # Declare the module for <IfModule directive> (remove this line on Apache 2.x)
  # Where to find workers.properties
  # Update this path to match your conf directory location (put
workers.properties next to httpd.conf)
  JkWorkersFile /etc/apache2/workers.properties
  # Where to put jk shared memory
  # Update this path to match your local state directory or logs directory
  JkShmFile     /var/log/apache2/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/apache2/mod_jk.log
  # Set the jk log level [debug/error/info]
  JkLogLevel    debug
  # Select the timestamp log format
  JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
  # Send everything for context /examples to worker named worker1 (ajp13)
  JkMount  /clover/* worker1
  JkMount  /manager/* worker1
  JkMountFile uriworkermap.properties


A cui bisogna aggiungere altri due o tre file...

Insomma, convinto? ^_^


Reply to: