tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bojan Smojver <>
Subject Re: JK2: Configuration(1)
Date Sat, 08 Dec 2001 01:00:36 GMT 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

# Web Application Server
# Apache and Tomcat Control Script
# chkconfig: 345 86 14
# description: Web Application Server



if [ -z "`echo $PATH | grep '/usr/local/jdk/bin'`" ]; then
  export PATH=$PATH:/usr/local/jdk/bin

case "$1" in
    su - $APACHEUS -c "$TOMCATSH $1" >>$TOMCATER 2>&1
    $APACHESH $1
    touch /var/lock/subsys/was
    su - $APACHEUS -c "$TOMCATSH $1" >>$TOMCATER 2>&1
    $APACHESH $1
    rm -f /var/lock/subsys/was
    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)"

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.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message