Date: Mon, 4 Feb 2002 18:49:48 +0100 From: "Remco van 't Veer" <rwvtveer@xs4all.nl> To: Ernst de Haan <ernsth@nl.euro.net> Cc: java@FreeBSD.ORG Subject: Re: Port updated: www/jakarta-tomcat Message-ID: <20020204174948.GH55277@azrael.xs4all.nl> In-Reply-To: <200202041342.g14DgE516387@zaphod.euronet.nl> References: <200202041342.g14DgE516387@zaphod.euronet.nl>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
JSP don't work because the JAVA_HOME (if not set) is setup after
trying to include tools.jar in de CLASSPATH. Attached you will
find a modified version of tomcatctl which sets up tools.jar
properly and puts the JVM in the background when starting.
Remco
PS. great work, thanks!
On Mon, Feb 04, 2002 at 14:42, Ernst de Haan wrote:
> The Tomcat port has been updated. Changes:
>
> * Bumped PORTREVISION
> * Now displays installation settings
> * Now possible to choose JDK. By default uses FreeBSD JDK 1.3.1 (instead of
> FreeBSD JDK 1.1.8)
> * Does not depend on pinstall anymore
> * Now possible to change TOMCAT_HOME. By default uses
> ${PREFIX}/jakarta-tomcat-3.2.3 (instead of ${PREFIX}/tomcat)
> * Now possible to change LISTEN_PORT. Default is 8080 (unchanged)
> * Added support for running Tomcat as a different user/group. By default a
> new user 'tomcat' and a new group 'tomcat' are created and used
> * A 'tomcatctl' script is installed in /usr/local/bin/, which uses
> interprocess communication to start/stop/restart Tomcat
> * Option is added for automatically starting Tomcat after install
> (AUTO_START). By default Tomcat is started right away
> * Appends stdout and stderr to log files
> * Uses a numeric prefix for the script in ${LOCALBASE}/etc/rc.d (now by
> default 020.jakarta-tomcat.sh instead of tomcat.sh)
>
> Comments are welcome. Working on the transition to 3.3a now...
>
> Ernst
--
It is our responsibility to achieve progress in harnessing evolutionary
mega-assets and speedily generating scalable mindshare.
[-- Attachment #2 --]
#!/bin/sh
# Set some variables
VERSION=3.2.3
APP_HOME=/usr/local/jakarta-tomcat3.2.3
USER_NAME=tomcat
STDOUT_LOG=/usr/local/jakarta-tomcat3.2.3/logs/stdout.log
STDERR_LOG=/usr/local/jakarta-tomcat3.2.3/logs/stderr.log
JAR_FILE=${APP_HOME}/lib/webserver.jar
MYSELF=`basename $0`
# Set the CLASSPATH
unset CLASSPATH
for i in ${APP_HOME}/lib/* ; do
if [ "$CLASSPATH" != "" ]; then
CLASSPATH=${CLASSPATH}:$i
else
CLASSPATH=$i
fi
done
# Check if we're being run as a shell script or as an rc script
if [ ${MYSELF} = "jakarta-tomcat.sh" ]; then
AS_RC_SCRIPT=yes
else
AS_RC_SCRIPT=no
fi
# Check if the JAVA_HOME directory is defined, otherwise set it to the
# fallback default
if [ "${JAVA_HOME}a" = "a" ]; then
JAVA_HOME=/usr/local/jdk1.3.1
fi
JAVA_CMD=${JAVA_HOME}/bin/java
# include tools.jar for jasper
if [ -f ${JAVA_HOME}/lib/tools.jar ] ; then
CLASSPATH=${CLASSPATH}:${JAVA_HOME}/lib/tools.jar
fi
# Function that starts the application
start() {
# Make sure the application directory does exist
if [ ! -d ${APP_HOME} ]; then
if [ "${AS_RC_SCRIPT}" = "yes" ]; then
echo ""
fi
echo "tomcat: ERROR: Unable to find Jakarta Tomcat home directory at ${APP_HOME}."
exit 2
fi
# Make sure the application JAR file exists
if [ ! -r ${JAR_FILE} ]; then
if [ "${AS_RC_SCRIPT}" = "yes" ]; then
echo ""
fi
echo "tomcat: ERROR: Unable to find Jakarta Tomcat JAR file at ${JAR_FILE}."
exit 3
fi
# Make sure the Java VM can be found
if [ ! -x ${JAVA_CMD} ]; then
if [ "${AS_RC_SCRIPT}" = "yes" ]; then
echo ""
fi
echo "tomcat: ERROR: Unable to find Java VM at ${JAVA_HOME}."
exit 4
fi
if [ "${AS_RC_SCRIPT}" = "yes" ]; then
echo -n " tomcat"
fi
su - ${USER_NAME} -c "(cd ${APP_HOME} && ${JAVA_CMD} -cp ${CLASSPATH} -Dtomcat.home=${APP_HOME} org.apache.tomcat.startup.Tomcat) >> ${STDOUT_LOG} 2>> ${STDERR_LOG} &"
}
# Function that stops the application
stop() {
if [ "${AS_RC_SCRIPT}" = "yes" ]; then
echo -n " tomcat"
fi
su - ${USER_NAME} -c "(cd ${APP_HOME} && ${JAVA_CMD} -cp ${CLASSPATH} -Dtomcat.home=${APP_HOME} org.apache.tomcat.startup.Tomcat -stop) >> ${STDOUT_LOG} 2>> ${STDERR_LOG}"
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo ""
echo "Usage: ${MYSELF} { start | stop | restart }"
echo ""
exit 64
;;
esac
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020204174948.GH55277>
