tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Redding <t...@tribalddb.co.uk>
Subject Re: Apache/mod_jk serves random files from tomcat
Date Fri, 11 Jul 2008 15:01:12 GMT


Thanks for the quick reply.  I've enabled the AccessLogValve.  I've just
gotta wait for it to start playing up again.  Could be 2 hours or 2 weeks. 
I'll reply when I have more info.

Tim.


Len Popp wrote:
> 
> That log file is from the httpd server, right? What does the Tomcat
> log file say? (Turn on AccessLogValve if you haven't already.) Is
> Tomcat always getting requests for the correct file, or is mod_jk
> requesting the wrong file sometimes?
> -- 
> Len
> 
> 
> On Thu, Jul 10, 2008 at 11:44, Tim Redding <timr@tribalddb.co.uk> wrote:
>>
>> Hi,
>>
>> 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.
>>
>>
>> Tim.
>>
>>
>>
>> ============= mod_jk.conf ==========
>>
>> # Load mod_jk module
>> # Specify the filename of the mod_jk lib
>> LoadModule jk_module modules/mod_jk.so
>>
>> # Where to find workers.properties
>> JkWorkersFile conf/workers.properties
>>
>> # 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 127.0.0.1
>> </Location>
>>
>>
>> ======= httpd.conf (our additions to the default file) ======
>>
>> # mod_jk include
>> Include conf/mod_jk.conf
>>
>> <VirtualHost *:80>
>>    DocumentRoot /var/www/html/
>>    ServerName example.co.uk
>>    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
>>    </Location>
>>
>>    Rewriteengine on
>>    RewriteRule ^/$ /index.html [R]
>>    jkmount /* loadbalancer
>>    jkunmount /logs/*.gz loadbalancer
>> </VirtualHost>
>>
>> <VirtualHost *:80>
>>    DocumentRoot /var/www/html/
>>    ServerName widgets.example.co.uk
>>    ErrorLog /var/widgets/widget-error.log
>>    CustomLog /var/widgets/widgets-access.log common
>>    jkunmount /* loadbalancer
>> </VirtualHost>
>>
>>
>> ======= worker.properties ======
>>
>> worker.list=loadbalancer,status
>> worker.node1.port=8009
>> worker.node1.host=127.0.0.1
>> worker.node1.type=ajp13
>> worker.node1.lbfactor=1
>> worker.loadbalancer.type=lb
>> worker.loadbalancer.balance_workers=node1
>> worker.status.type=status
>> --
>> View this message in context:
>> http://www.nabble.com/Apache-mod_jk-serves-random-files-from-tomcat-tp18385568p18385568.html
>> Sent from the Tomcat - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Apache-mod_jk-serves-random-files-from-tomcat-tp18385568p18405872.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message