apache2 + tomcat6 (on debian)
Primary tabs
In this article I will shortly tell how to install a tomcat server besides an apache server and make you files availeble under port 80 (apache). This can be handy when for example port 8080 is blocked ore something like that.
for the simplicity I assume that you have apache2 already installed and configured.
First step: install tomcat.
This is the most simple step. Just do:
apt-get install tomcat6
Second step: install mod_jk
Install the libs with apt-get:
apt-get install libapache2-mod_jk a2enmod jk
Then we make a file workers.properties in the folder /etc/apache2 with this content:
workers.tomcat_home=/var/lib/tomcat6 workers.java_home=/usr/lib/jvm/java-6-sun ps=/ worker.list=default worker.default.port=8009 worker.default.host=localhost worker.default.type=ajp13 worker.default.lbfactor=1 worker.loadbalancer.type=lb
Also, in /etc/apache2/mods-enabled we need to make a file called jk.conf and at those lines:
JkWorkersFile /etc/apache2/workers.properties JkLogFile /var/log/apache2/mod_jk.log # Set the jk log level [debug/error/info] JkLogLevel info # Select the log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " # JkOptions indicate to send SSL KEY SIZE, JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories # JkRequestLogFormat set the request format JkRequestLogFormat "%w %V %T" # Send servlet for context / jsp-examples to worker named worker1 JkMount /jsp-examples default # Send JSPs for context /jsp-examples/* to worker named worker1 JkMount /jsp-examples/* default
When the this is done you only have to edit your /etc/tomcat6/server.xml file:
After this one a restart from apache and tomcat is necessary
/etc/init.d/apache2 restart /etc/init.d/tomcat6 restart
Comments
follow up
small thing i wass forgotten; you have to add:
JkMount /*.action default
JkMountCopy On
Add new comment