Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 74040 invoked from network); 8 Dec 2001 01:19:25 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 8 Dec 2001 01:19:25 -0000 Received: (qmail 12910 invoked by uid 97); 8 Dec 2001 01:19:21 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 12845 invoked by uid 97); 8 Dec 2001 01:19:20 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 12751 invoked from network); 8 Dec 2001 01:19:19 -0000 Sender: bojan@binarix.com Message-ID: <3C116634.8DA53EBA@binarix.com> Date: Sat, 08 Dec 2001 12:00:36 +1100 From: Bojan Smojver Organization: Binarix Corporation Pty Ltd X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.16 i686) X-Accept-Language: en MIME-Version: 1.0 To: Tomcat Developers List Subject: Re: JK2: Configuration(1) References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N costinm@covalent.net wrote: > > To clarify - this is not a replacement or an 'exclusive' mechanism. > The 'ajp14' based config, where tomcat sends notifications to apache > remains. Seems like I was reinventing the wheel there for a while. So AJP14 knows how configure itself from the running Tomcat... Pretty cool in my book! > The problems with 'tomcat sending config info to apache' ( and why I > would not make that the 'default' simple config ): > > 1. It requires a strict startup sequence ( tomcat before apache ). > Otherwise, if tomcat is not started apache will respond '404' for > what it doesn't recognize, instead of 'temporary unavailable' or 'context > is down'. This can be very problematic for users ( who'll assume the url > is wrong instead of try again later ). This is easily achieved (that's how I run my boxes) through the startup script when both Apache and Tomcat are on the same box. I call this thing 'was' -> Web Application Server. Here is the sample (RH Linux 7.0): ------------------------------- #!/bin/sh # # Web Application Server # Apache and Tomcat Control Script # # chkconfig: 345 86 14 # description: Web Application Server # TMCTLOC=/usr/local/tomcat TOMCATSH="$TMCTLOC/bin/tomcat.sh" TOMCATER="/var/tomcat/logs/tomcat_error.log" APACHESH="/usr/sbin/apachectl" APACHEUS="apache" SLEEPTM="2" if [ -z "`echo $PATH | grep '/usr/local/jdk/bin'`" ]; then export PATH=$PATH:/usr/local/jdk/bin fi case "$1" in start) su - $APACHEUS -c "$TOMCATSH $1" >>$TOMCATER 2>&1 $APACHESH $1 touch /var/lock/subsys/was ;; stop) su - $APACHEUS -c "$TOMCATSH $1" >>$TOMCATER 2>&1 $APACHESH $1 rm -f /var/lock/subsys/was ;; restart) su - $APACHEUS -c "$TOMCATSH stop" >>$TOMCATER 2>&1 su - $APACHEUS -c "$TOMCATSH start" >>$TOMCATER 2>&1 /bin/sleep $SLEEPTM $APACHESH graceful touch /var/lock/subsys/was ;; *) echo "usage: $0 (start|stop|restart|help)" esac ------------------------------- It would probably require a bit or work when those are on different machines. Little bit of OpenSSH and it'd all work out just fine... > 2. Apache ( or server ) configs will be located on the server machine > anyway. I prefer keeping it centralized, and maybe have a mechanism to > rsync the webapps directory from the master to the workers instead of reverse. It would just be a different kind of script. I kind of like the idea of having things in one place only. Bojan -- To unsubscribe, e-mail: For additional commands, e-mail: