Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 15829 invoked from network); 21 May 2007 21:47:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 May 2007 21:47:55 -0000 Received: (qmail 68207 invoked by uid 500); 21 May 2007 21:47:47 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 68185 invoked by uid 500); 21 May 2007 21:47:47 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 68174 invoked by uid 99); 21 May 2007 21:47:46 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 May 2007 14:47:46 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [195.227.30.246] (HELO datura.kippdata.de) (195.227.30.246) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 May 2007 14:47:38 -0700 Received: from [192.168.2.120] ([192.168.2.120]) by datura.kippdata.de (8.13.5/8.13.5) with ESMTP id l4LLlFAF015757 for ; Mon, 21 May 2007 23:47:16 +0200 (CEST) Message-ID: <46521389.70909@kippdata.de> Date: Mon, 21 May 2007 23:47:53 +0200 From: Rainer Jung User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: mod_jk problem References: <4B518E6046247D418A5B86BB5B08389A6FB540@UXCHANGE3.UoA.auckland.ac.nz> In-Reply-To: <4B518E6046247D418A5B86BB5B08389A6FB540@UXCHANGE3.UoA.auckland.ac.nz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org You really should totally drop the idea of rotating an open logfile from the outside. The file descriptor is open in the writing process and it will proceed to use the file descriptor, which will point to the rotated file and after compression will be deleted. Really a very bad idea. Usually if you need to rotate a log file from the outside, you need to take down the process during the rotation. If a process implements a signal or restart procedure, you can also send a signal or restart command after rotatting and before further manipulation on the file. Why aren't you simply using apache httpd rotatelogs, as suggested in my last post? http://httpd.apache.org/docs/2.0/programs/rotatelogs.html Regards, Rainer Yifan (Eric) Jiang wrote: > Hi Rainer, > > Thanks for all your helps. I know that is a very outdated version of > httpd, > But since it is in a production server, and the server for the > authentication of the whole university, so it is unlikely, or it is > impossible for me to do any big change on it. And it is weird, because > it is running completely fine in the test server which is the > replication for the production server. > > So we are trying to reproduce the same error/bug that occurred in the > production server, but unfortunately we still can't reproduce it. Any > idea why? > > > Thanks > > Regards > > Eric > > -----Original Message----- > From: Rainer Jung [mailto:rainer.jung@kippdata.de] > Sent: Monday, 21 May 2007 7:26 p.m. > To: Tomcat Users List > Subject: Re: mod_jk problem > > Rotating an open log file from outside the using processes is a very bad > > idea. The processes in most cases will simply try to use the old log > file further on (and will run into trouble, after you compressed them > etc.). > > Rotating log files for apache can be easily done using the bundles > rotatelogs (see the Apache httpd documentation). > > mod_jk is able to use rotatelogs with JkLogFile as well, and the syntax > is the same as for the other Apache httpd log files > ("|/pathtorotatelogs/rotatelogs /pathtologfile/logfile OPTIONS"). > > Since I'm interested in the root of your problem nevertheless, if you > can reproduce it, try to get a pstack (solaris) or gstack[?] (linux) of > your running httpd processes, once the problem occurs. In case threads > are hanging, this will tel us, where they are. > > By the way: your httpd is a pretty outdated version. The 2.0 branch is > at 2.0.59 and there is 2.2.x around for 1.5 years now. (I'm not saying > such an update will solve your problem, but the other two components are > > pretty up to date, so updating your apache would make a good fit). > > Regards, > > Rainer > > Yifan (Eric) Jiang wrote: >> Hi all, >> >> >> >> Not quite sure if this list is the best place to send this question. > But >> I can't find anywhere else to send it to... >> >> >> >> I am trying to install Shibboleth (http://shibboleth.internet2.edu/) >> Identity Provider with Cosign protection on a RedHat Linux production >> server. >> >> Well, Shibboleth Identity Provider is a Java Application and is using >> Tomcat as a Java container. Therefore for the user conveniences, I > have >> to load a mod_jk module into Apache in order to build a connection >> between Apache and Tomcat. >> >> >> >> I am using Apahce2.0.46, mod_jk 1.2.22 and Tomcat 5.5.23. After the >> Shibboleth Identity Provider installation, everything is running >> perfectly fine until the log rotation has been triggered by the cron > job >> at mid-night. >> >> >> >> The cron job has the following configuration: >> >> 59 23 * * * /usr/local/etc/rotate.log > --move >> --after=/usr/local/etc/rotate.log-after.std /var/log >> >> 59 23 * * * /usr/local/etc/rotate.log > --move >> --after=/usr/local/etc/rotate.log-apache /var/log/httpd >> >> >> >> So after the log rotation, Apache appears to have some problems to >> restart. It returns a HTTP 500 error to users, and the ssl_error_log >> file has logged a "Premature end of script headers: cosign.cgi" error. >> Therefore it requires the administrator to restart the Apache > manually. >> >> >> Before I thought it was caused by Shibboleth and Cosign, so I just >> disable the Cosign module for Apache. However, the error still happens >> on the next day after the log rotation. Then I realised it may be > cause >> by the mod_jk, so I disable the mod_jk module and the Apache is back > to >> normal, even after the log rotation. >> >> >> >> I have not idea what exactly caused this problem, and the log for >> mod_jk, Apache doesn't give me much help. So does anyone know this >> issue? >> >> >> >> Any information in regards of this would be much appreciated. >> >> >> >> Thanks >> >> >> >> Eric --------------------------------------------------------------------- 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