• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Tomcat + Apache first time

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Trying to get Apache and Tomcat set up together for the first time. I've used them separately with different projects before without problems, but now I've got to get things set up so all web pages are served through Apache.

I've downloaded mod_jk and been trying to follow the instructions on Apache's website for getting them working together but not having much luck. I think I'm just not understanding how to configure the URI mappings to point specific websites/files in Apache to Tomcat. I've got quite a few php websites set up with Virtual Hosting in Apache already and they're working fine. All my website data is in /var/www/ and I'd like to keep the sites requiring JSP in the same location instead of $TOMCAT_HOME/webapps.

I'm running Ubuntu 6.06 LTS Server and am using the Debian mod/conf file configuration they've adopted. My configuration files are below. I just copied the sample configuration files that came with the mod-jk source code and modified them for my site. Currently whenever I try and load a JSP page, I'm getting redirected to the Tomcat server properly, but I'm getting 404 errors saying the files don't exist when I know they do.

Any help getting me on the right track would be appreciated!

My files:

mod-jk.load:
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so

-----------
mod-jk.conf:
# Where to find workers.properties
JkWorkersFile /etc/apache2/mods-enabled/workers.properties

# Where to put jk shared memory
JkShmFile /var/run/apache2/jk.shm

# Where to put jk logs
JkLogFile /var/log/apache2/mod_jk.log
# [debug/error/info]
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkRequestLogFormat "%w %V %T"

-----------
workers.properties:
# workers.properties.minimal -
#
# This file provides minimal jk configuration properties needed to
# connect to Tomcat.
#
# The workers that jk should create and work with
#

worker.list=wlb,jkstatus

#
# Defining a worker named ajp13w and of type ajp13
# Note that the name and the type do not have to match.
#
worker.ajp13w.type=ajp13
worker.ajp13w.host=localhost
worker.ajp13w.port=8009

#
# Defining a load balancer
#

worker.wlb.type=lb
worker.wlb.balance_workers=ajp13w

#
# Define status worker
#

worker.jkstatus.type=status


-----------
uriworkermap.properties
# uriworkermap.properties
#
# This file provides sample mappings for example wlb
# worker defined in workermap.properties.minimal
# The general syntax for this file is:
# [URL]=[Worker name]

/*.jsp=wlb
/!*.html=wlb

#
# Mount jkstatus to /jkmanager
# For production servers you will need to
# secure the access to the /jkmanager url
#
/jkmanager=jkstatus

-----------
Line added to my Virtual Host config file for this site in Apache:

JkMountFile /etc/apache2/mods-enabled/uriworkermap.properties
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic