Install&Configure Apache/Tomcat

Each time I do this I have to googel what to do. Here's my personal guide.

Install

On Ubuntu:
sudo apt-get install apache2
sudo apt-get install libapache2-mod-jk

Tiis install mod_jk.so in /usr/lib/apache2/modules/mod_jk.so and creates a file mods-enabled/jk.load with the following content:

LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so

Add your configuration:

<IfModule jk_module>
JkWorkersFile /etc/apache2/mods-enabled/workers.properties
JkLogFile /var/log/apache2/mod_jk.log
JkLogLevel warn
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize -ForwardDirectories
JkRequestLogFormat "%w %V %T"
JkMountCopy All
JkMount /my_path/* worker1
</IfModule>

Create workers.properties:

{{
workers.tomcat_home=/usr/local/tomcat6
workers.java_home=workers.tomcat_home=/usr/share/tomcat6
workers.java_home=/usr/lib/jvm/java-6-sun-1.6.0.15
ps=

  1. Define worker 'worker1'

worker.list=worker1,jkstatus

  1. Set properties for worker 'worker1' (ajp13)

worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009

#worker.ajp13worker1.lbfactor=1
worker.worker1.connection_pool_size=10
worker.worker1.connection_pool_timeout=300
worker.worker1.socket_keepalive=1

worker.jkstatus.type=status
}}

Restart:

/etc/init.d/apache2 restart

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License