0

I'm relatively new to ubuntu or any linux systems but I needed to do a test to see if I could get the program working on ubuntu. I have gone through this process of going about installing multiple instances of tomcat7 :HOW TO INSTALL MULTIPLE INSTANCES OF TOMCAT ON A SINGLE UBUNTU SERVER using the process that was written in here and after a slight bit confusion of the last section which was this piece:

NAME=timo
DESC="Tomcat Timo servlet engine"
#DEFAULT=/etc/default/$NAME
DEFAULT=/etc/default/tomcat6
JVM_TMP=/tmp/$NAME-tmp
CATALINA_HOME=/usr/share/tomcat6
#CATALINA_BASE=/var/lib/$NAME
CATALINA_BASE=/opt/tomcat6/timo

I thought I had managed to get it working as it did not give me any errors when I used the startup.sh file but when I go to firefox to view the tomcat page I get an empty page. There is no error message and when I look into the logs nothing seems to be popping up that says its broken. It is like that with both instances. The reason I am running 2 instances is because I would like to run geoserver on one and geowebcache on the other one.

Any info or help would be great.

In the mod_jk.log file I get : [30683:140717698082688] [info] init_jk::mod_jk.c(3365): mod_jk/1.2.37 initialized [30683:140717698082688] [error] extension_fix::jk_uri_worker_map.c9564): could not find worker with name 'jk-manager' in uri map post processing [30683:140717698082688] [error] extension_fix::jk_uri_worker_map.c9564): could not find worker with name 'jk-status' in uri map post processing

and an error log shows: [mpm_event:notice] [pid 299559:tid 140144594913152] AH00489: Apache/2.4.7(Ubuntu) configured -- resuming normal opertaions [core:notice] [pid 29559:tid 140144594913152] AH00094: Command line: '/usr/sbin/apache2' [mpm_event:notice] [pid 299559:tid 140144594913152] AH00491: caught SIGTERM, shutting down [mpm_event:notice] [pid 30684:tid 140717698082688] AH00489: Apache/2.4.7 (Ubuntu) mod_jk/1.2.37 configured -- resuming normal operations

worker.properties file:

#setup
worker.geoserver.port=8009 #ajp port on geoserver server
worker.geoserver.host=localhost
worker.geoserver.type=ajp13
worker.heoserver.lbfactor=2

#setup geowebcache
worker.geowebcache.port=8010 #ajp port on geoserver server
worker.geowebcache.host=localhost
worker.geowebcache.type=ajp13
worker.geowebcache.lbfactor=1

#setup the load-balancer
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers-geoserver,geowebcache
worker.loadbalancer.sticky_session=True
#worker.loadbalancer.sticky_session_force=True

#Status worker for managing load balancer
worker.jk-status.type=status #setting type of jk-status 'worker

I created my own virtualhost instead of using the default one as the tutorial suggested so it goes as follows:

#/etc/apache2/sites-available/ourgeoserver.org
<VirtualHost *:80>
  ServerAdmin [email protected]
  ServerAlias live.ourgeoserver.org
  ServerName ourgeoserver.org
  JkMount /* loadbalancer
  JKMount / jk-manager /*jk-status
  loglevel warn
  ErrorLog /var/log/apache2/ourgeoserver_error_log
  CustomLog /var/log/apache2/ourgeoserver_access_log combined
<VirtualHost>
11
  • did you install apache and mod_jk?
    – Lety
    Jun 19, 2014 at 20:34
  • I have installed apache and modjk and followed the instructions on the second part of the one above.
    – Ravyn
    Jun 20, 2014 at 10:12
  • And what about apache log and modjk log?
    – Lety
    Jun 20, 2014 at 10:54
  • I added the logs in the top part
    – Ravyn
    Jun 20, 2014 at 12:34
  • can you post worker.properties file and httpd configuration? It seems that jk-status and jk-manager are not defined
    – Lety
    Jun 20, 2014 at 14:18

1 Answer 1

0

Module mod_jk is the Tomcat redirector module that requires workers.properties and httpd configuration file update.

workers.properties is a file that describes the host(s) and port(s) used by the workers (Tomcat processes).

If your Tomcat application are stand-alone, you don't need to define loadbalancer worker that provide load balancing, meaning run multiple Tomcat workers each on a machine of its own and distribute the requests between them.

Your file should be:

 worker.geoserver.port=8009 #ajp port on geoserver server
 worker.geoserver.host=localhost
 worker.geoserver.type=ajp13

 worker.geowebcache.port=8010 #ajp port on geoserver server
 worker.geowebcache.host=localhost
 worker.geowebcache.type=ajp13 

 worker.jk-status.type=status
 worker.list=jk-status, geowebcache, geoserver

Where worker jk-status is a special type of worker that does not forward requests to Tomcat instances. Instead it allows to retrieve status and configuration information at runtime, and furthermore to change many configuration items dynamically. This can be done via a simple embedded web interface.

In apache httpd configuration file in this case /etc/apache2/sites-available/ourgeoserver.org:

  JkWorkersFile /path/workers.properties

where path is where you have saved your workers.properties file.

  JkLogFile "|/usr/bin/rotatelogs /var/log/httpd/mod_jk.log 86400"
  JkLogLevel info
  JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

for activate logs, this is an examples, change path as you need

  JkMount /url1|/*=geoserver
  JkMount /url2|/*=geowebcache
  JkMount /status|/*=jk-status

where url1 and url2 are the initial part of url. Apache choose worker base on http url

2
  • Is the apache httpd configuration file the apache2.conf or httpd-jk.conf or another file?
    – Ravyn
    Jun 24, 2014 at 9:54
  • I updated the answer
    – Lety
    Jun 24, 2014 at 10:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .