tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Redding <>
Subject Apache/mod_jk serves random files from tomcat
Date Thu, 10 Jul 2008 15:44:35 GMT


We are experiencing intermittent problems with a particular site that is not
returning the correct file that is requested.  For instance if we request
the index.html file we actually get a css file or even an image.  From the
apache access log you can see that the size of the index.html file grows on
the second request. This is because a gif was actually returned.

XXX.XXX.XXX.130 - - [10/Jul/2008:15:10:39 +0100] "GET /index.html HTTP/1.1"
200 1068
XXX.XXX.XXX.130 - - [10/Jul/2008:15:13:10 +0100] "GET /index.html HTTP/1.1"
200 9526
XXX.XXX.XXX.130 - - [10/Jul/2008:15:13:48 +0100] "GET /index.html HTTP/1.1"
200 1086

No error messages are logged in the mode_jk.log file.

We have Apache/2.2.3 on the front on a Tomcat 6.0.16 server with mod_jk
(version unknown but fairly recent).  We have all assets in our war file. 
When we hit Tomcat directly on port 8080 it serves the correct file. And to
fix the problem an apache restart seems to sort things out.

On this server with have 2 vhosts.  One is a simple nothing fancy static
site and the other forwards everything to our Tomcat server.  Below I've
included our mod_jk config and a snippet of our httpd.conf.  

Any ideas or things to try would be most appreciated.


============= mod_jk.conf ==========

# Load mod_jk module
# Specify the filename of the mod_jk lib
LoadModule jk_module modules/

# Where to find
JkWorkersFile conf/

# Where to put jk logs
JkLogFile logs/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLevel debug

# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"

# JkOptions indicates to send SSK KEY SIZE
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

# JkRequestLogFormat
JkRequestLogFormat "%w %V %T"

# Add shared memory.
# This directive is present with 1.2.10 and
# later versions of mod_jk, and is needed for
# for load balancing to work properly
JkShmFile logs/jk.shm

# original URL pass through
JkEnvVar    ORIGINAL_URI    w00t

# Add jkstatus for managing runtime data
<Location /jkstatus/>
JkMount status
Order deny,allow
Deny from all
Allow from

======= httpd.conf (our additions to the default file) ======

# mod_jk include
Include conf/mod_jk.conf

<VirtualHost *:80>
    DocumentRoot /var/www/html/
    ErrorLog logs/default-error.log
    CustomLog logs/default-access.log common
    alias /logs /var/widgets
    <Location /logs>
        AuthUserFile /var/widgets/.htpasswd
        AuthName "Widgets"
        AuthType Basic
        Require valid-user
    Rewriteengine on
    RewriteRule ^/$ /index.html [R]
    jkmount /* loadbalancer
    jkunmount /logs/*.gz loadbalancer

<VirtualHost *:80>
    DocumentRoot /var/www/html/
    ErrorLog /var/widgets/widget-error.log
    CustomLog /var/widgets/widgets-access.log common
    jkunmount /* loadbalancer

======= ======

View this message in context:
Sent from the Tomcat - User mailing list archive at

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message