diff -u tomcat6-6.0.16/debian/changelog tomcat6-6.0.16/debian/changelog --- tomcat6-6.0.16/debian/changelog +++ tomcat6-6.0.16/debian/changelog @@ -1,3 +1,30 @@ +tomcat6 (6.0.16-1ubuntu1) intrepid; urgency=low + + * Adding full Tomcat 6 server stack support (LP: #256052) + - tomcat6 handles the system instance (/var/lib/tomcat6) + - tomcat6-user allows users to create their own private instances + - tomcat6-common installs common files in /usr/share/tomcat6 + - libtomcat6-java installs Tomcat 6 java libs in /usr/share/java + - tomcat6-docs installs the documentation webapp + - tomcat6-examples installs the examples webapp + - tomcat6-admin installs the manager and host-manager webapps + * Other key differences with the tomcat5.5 packages: + - default-jdk build support + - OpenJDK-6 JRE runtime support + - tomcat6 installs a minimal ROOT webapp + - new webapp locations follow Debian webapp policy + - webapps restart tomcat6 in postrm rather than in prerm + - added a doc-base entry + - use standard upstream server.xml + - initscript: try to check if Tomcat is really running before returning OK + - removed transitional configuration migration code + - autogenerate policy in /var/cache/tomcat6 rather than /etc/tomcat6 + - logging.properties is customized to remove -webapps-related lines + - initscript: implement TearDown spec + * CVE-2008-1947 fix (cross-site-scripting issue in host-manager webapp) + + -- Thierry Carrez Fri, 08 Aug 2008 15:37:48 +0200 + tomcat6 (6.0.16-1) unstable; urgency=low * Initial release. diff -u tomcat6-6.0.16/debian/README.Debian tomcat6-6.0.16/debian/README.Debian --- tomcat6-6.0.16/debian/README.Debian +++ tomcat6-6.0.16/debian/README.Debian @@ -1,5 +1,22 @@ -The tomcat6 source package will eventually be used to build the -complete Tomcat 6 system. At the moment, though, it just builds -servlet-api-2.5.jar, jsp-api-2.1.jar and el-api-2.1.jar. +Main differences with the Tomcat 5.5 packages: --- Paul Cager Mon, 12 May 2008 23:04:49 +0000 +- These packages conform to the CATALINA_BASE spec described in RUNNING.txt, + in order to be able to run multiple instances of Tomcat on the same + machine. +- The tomcat6 package installs the system instance and init scripts with + CATALINA_BASE in /var/lib/tomcat6. It installs a minimal ROOT webapp to + check that everything works correctly. +- A new tomcat6-user package has been created. This package allows users to + create their own user instance of tomcat (CATALINA_BASE) by calling the + create-user-tomcat.sh script located in /usr/share/tomcat6/bin. It does not + require to install the system instance (tomcat6 package). +- The new package tomcat6-common contains files common to tomcat6-user and + tomcat6. It implements the common CATALINA_HOME in /usr/share/tomcat6. +- The docs (and associated webapp) have been put in a separate tomcat6-docs + package. +- The -webapps package has been replaced by a tomcat6-examples package that + just contains the examples webapp. +- The catalina.policy file for the system instance is now autogenerated in + /var/cache/tomcat6. + +-- Thierry Carrez Thu, 24 Jul 2008 09:52:31 +0200 diff -u tomcat6-6.0.16/debian/copyright tomcat6-6.0.16/debian/copyright --- tomcat6-6.0.16/debian/copyright +++ tomcat6-6.0.16/debian/copyright @@ -1,6 +1,11 @@ This package was debianized by Paul Cager Wed, 14 May 2008 10:29:00 +0100. +It was heavily modified to support the full Tomcat6 server stack by +Thierry Carrez , based on the great work done by +the Debian Java Maintainers +on Tomcat 5.5 and initial packaging by David Pashley . + It was downloaded from http://tomcat.apache.org Copyright: @@ -319,0 +325,2 @@ + +Ubuntu full server stack repackaging is Copyright (C) 2008 Canonical Ltd. diff -u tomcat6-6.0.16/debian/rules tomcat6-6.0.16/debian/rules --- tomcat6-6.0.16/debian/rules +++ tomcat6-6.0.16/debian/rules @@ -3,20 +3,97 @@ -include /usr/share/cdbs/1/class/ant.mk -include /usr/share/cdbs/1/rules/debhelper.mk -include /usr/share/cdbs/1/rules/simple-patchsys.mk - -JAVA_HOME := /usr/lib/jvm/java-gcj -DEB_ANT_BUILD_TARGET := build-only -DEB_ANT_BUILDFILE := build.xml -DEB_JARS := -ANT_OPTS := -Dversion=$(DEB_UPSTREAM_VERSION) -Dcomponent=$(DEB_SOURCE_PACKAGE) - -install/libservlet2.5-java:: - mv output/build/lib/servlet-api.jar output/build/lib/servlet-api-2.5.jar - mv output/build/lib/jsp-api.jar output/build/lib/jsp-api-2.1.jar - mv output/build/lib/el-api.jar output/build/lib/el-api-2.1.jar - dh_install output/build/lib/servlet-api-2.5.jar usr/share/java - dh_install output/build/lib/jsp-api-2.1.jar usr/share/java - dh_install output/build/lib/el-api-2.1.jar usr/share/java +include /usr/share/quilt/quilt.make + +JAVA_HOME := /usr/lib/jvm/default-java +JAVA_CMD := $(JAVA_HOME)/bin/java +BLDLIB := output/build/lib +DEB_JARS_BASE := /usr/share/java +DEB_JARS := ant ant-launcher ant-trax +DEB_CLASSPATH = $(shell for jar in $(DEB_JARS); do \ + if [ -f "$$jar" ]; then echo -n "$${jar}:"; fi; \ + if [ -f "$$jar".jar ]; then echo -n "$${jar}.jar:"; fi; \ + if [ -f $(DEB_JARS_BASE)/"$$jar" ]; then \ + echo -n "$(DEB_JARS_BASE)/$${jar}:"; fi; \ + if [ -f $(DEB_JARS_BASE)/"$$jar".jar ]; then \ + echo -n "$(DEB_JARS_BASE)/$${jar}.jar:"; fi; \ + done; \ + if [ -f "$(JAVA_HOME)/lib/tools.jar" ]; then \ + echo -n "$(JAVA_HOME)/lib/tools.jar"; fi) + +T_VER := $(shell dpkg-parsechangelog | egrep '^Version:' \ + | cut -f 2 -d ' ' | cut -f 2 -d ' '|sed 's/-[^-]*$$//') +T_JARS := jasper-el annotations-api catalina-tribes tomcat-i18n-fr tomcat-i18n-es tomcat-i18n-ja tomcat-coyote jasper catalina-ha catalina-ant catalina + +ANT_ARGS := -Dcompile.debug=true\ + -Djdt.jar=/usr/share/java/ecj.jar\ + -Dversion=$(T_VER) + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + ANT_ARGS += -Dcompile.optimize=false +else + ANT_ARGS += -Dcompile.optimize=true +endif + +ANT_INVOKE := $(JAVA_CMD) -classpath $(DEB_CLASSPATH)\ + org.apache.tools.ant.Main $(ANT_ARGS) + +build: build-stamp +build-stamp: patch + dh_testdir + $(ANT_INVOKE) build-only + $(ANT_INVOKE) build-docs + $(ANT_INVOKE) deploy-webapps + touch build-stamp + +clean: unpatch + dh_testdir + dh_testroot + $(ANT_INVOKE) clean + rm -f build-stamp + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + +binary-indep: build install + dh_testdir + dh_testroot + mv $(BLDLIB)/servlet-api.jar $(BLDLIB)/servlet-api-2.5.jar + mv $(BLDLIB)/jsp-api.jar $(BLDLIB)/jsp-api-2.1.jar + mv $(BLDLIB)/el-api.jar $(BLDLIB)/el-api-2.1.jar + for i in $(T_JARS); do \ + mv $(BLDLIB)/$$i.jar $(BLDLIB)/$$i-$(T_VER).jar; done + dh_installchangelogs + dh_installdocs + dh_installman -ptomcat6-user debian/tomcat6-instance-create.1 + dh_installexamples + dh_installinit -- start 92 2 3 4 5 . stop 08 1 . + dh_installcron + for i in $(T_JARS); do \ + dh_install -plibtomcat6-java \ + $(BLDLIB)/$$i-$(T_VER).jar usr/share/java && \ + dh_link -plibtomcat6-java usr/share/java/$$i-$(T_VER).jar \ + usr/share/java/$$i.jar && \ + dh_link -ptomcat6-common usr/share/java/$$i-$(T_VER).jar \ + usr/share/tomcat6/lib/$$i.jar; done + dh_install --exclude=.bat --exclude=Thumbs.db + dh_link + chmod a+x debian/tomcat6-common/usr/share/tomcat6/bin/*.sh + chmod a+x debian/tomcat6-user/usr/bin/tomcat6-instance-create + chmod a+x debian/tomcat6-user/usr/share/tomcat6/skel/bin/*.sh + dh_compress + dh_fixperms + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +binary-arch: build install + +binary: binary-indep binary-arch get-orig-source: -uscan --upstream-version 0 + +.PHONY: build clean binary-indep binary-arch binary install get-orig-source diff -u tomcat6-6.0.16/debian/control tomcat6-6.0.16/debian/control --- tomcat6-6.0.16/debian/control +++ tomcat6-6.0.16/debian/control @@ -4,18 +4,100 @@ -Maintainer: Debian Java Maintainers +Maintainer: Ubuntu MOTU Developers +XSBC-Original-Maintainer: Debian Java Maintainers Uploaders: Paul Cager -Build-Depends: cdbs, debhelper (>= 6), ant -Build-Depends-Indep: java-gcj-compat-dev -Standards-Version: 3.7.3 +Build-Depends: default-jdk, + ant, + ant-optional, + debhelper (>=6), + quilt +Build-Depends-Indep: libecj-java +Standards-Version: 3.8.0 Homepage: http://tomcat.apache.org -Vcs-Svn: svn://svn.debian.org/svn/pkg-java/trunk/tomcat6 -Vcs-Browser: http://svn.debian.org/wsvn/pkg-java/trunk/tomcat6 + +Package: tomcat6-common +Architecture: all +Depends: libtomcat6-java (>= ${source:Version}) +Description: Servlet and JSP engine + Apache Tomcat 6 is the reference implementation for the Java Servlet 2.5 + and JavaServer Pages 2.1 technologies. + . + This package contains common files needed by the tomcat6 and tomcat6-user + packages (Tomcat 6 scripts and libraries). + +Package: tomcat6 +Architecture: all +Depends: tomcat6-common (>= ${source:Version}), + adduser, + jsvc +Suggests: tomcat6-docs (>= ${source:Version}), + tomcat6-admin (>= ${source:Version}), + tomcat6-examples (>= ${source:Version}) +Description: Servlet and JSP engine + Apache Tomcat 6 is the reference implementation for the Java Servlet 2.5 + and JavaServer Pages 2.1 technologies. + . + This package just contains the startup scripts for the system-wide daemon. + No documentation or web applications are included here, please install + the tomcat6-webapps package if you want them. + +Package: tomcat6-user +Architecture: all +Depends: tomcat6-common (>= ${source:Version}) +Description: Servlet and JSP engine + Apache Tomcat 6 is the reference implementation for the Java Servlet 2.5 + and JavaServer Pages 2.1 technologies. + . + This package contains files needed to create a user Tomcat instance. + +Package: libtomcat6-java +Architecture: all +Depends: java6-runtime-headless, + libecj-java, + libcommons-dbcp-java, + libcommons-pool-java, + libservlet2.5-java (>= ${source:Version}) +Suggests: tomcat6 (>= ${source:Version}) +Description: Servlet and JSP engine -- core libraries + Apache Tomcat 6 is the reference implementation for the Java Servlet 2.5 + and JavaServer Pages 2.1 technologies. + . + This package contains the Tomcat core classes which can be used by other + Java applications to embed Tomcat. Package: libservlet2.5-java Architecture: all -Depends: ${shlibs:Depends}, ${misc:Depends} +Depends: default-jre-headless | java2-runtime-headless Description: Servlet 2.5 and JSP 2.1 Java API classes and documentation For more information about Java servlets please take a look at the Tomcat home page at http://jakarta.apache.org/tomcat/index.html. . The official Servlet 2.5 and JSP 2.1 specifications can be found at http://java.sun.com/products/servlet/ and http://java.sun.com/products/jsp/. + +Package: tomcat6-admin +Architecture: all +Depends: tomcat6 (>= ${source:Version}) +Description: Servlet and JSP engine -- admin web applications + Apache Tomcat 6 is the reference implementation for the Java Servlet 2.5 + and JavaServer Pages 2.1 technologies. + . + This package contains the administrative web interfaces. + +Package: tomcat6-examples +Architecture: all +Depends: tomcat6 (>= ${source:Version}) +Description: Servlet and JSP engine -- example web applications + Apache Tomcat 6 is the reference implementation for the Java Servlet 2.5 + and JavaServer Pages 2.1 technologies. + . + This package contains the default Tomcat example webapps. + +Package: tomcat6-docs +Section: doc +Architecture: all +Depends: tomcat6 (>= ${source:Version}) +Description: Servlet and JSP engine -- example web applications + Apache Tomcat 6 is the reference implementation for the Java Servlet 2.5 + and JavaServer Pages 2.1 technologies. + . + This package contains the online documentation web application. + diff -u tomcat6-6.0.16/debian/orig-tar.sh tomcat6-6.0.16/debian/orig-tar.sh --- tomcat6-6.0.16/debian/orig-tar.sh +++ tomcat6-6.0.16/debian/orig-tar.sh @@ -1,12 +1,12 @@ #!/bin/sh -e -# $1 = version +# $2 = version -URL=http://apache.rmplc.co.uk/tomcat/tomcat-6/v$1/src/apache-tomcat-$1-src.tar.gz +URL=http://www.apache.org/dist/tomcat/tomcat-6/v$2/src/apache-tomcat-$2-src.tar.gz wget $URL || exit 2 -mv apache-tomcat-$1-src.tar.gz tomcat6_$1.orig.tar.gz || exit 2 +mv apache-tomcat-$2-src.tar.gz tomcat6_$2.orig.tar.gz || exit 2 reverted: --- tomcat6-6.0.16/debian/patches/build.xml.patch +++ tomcat6-6.0.16.orig/debian/patches/build.xml.patch @@ -1,12 +0,0 @@ ---- tomcat6-6.0.16.orig/build.xml -+++ tomcat6-6.0.16/build.xml -@@ -109,8 +109,7 @@ - excludes="**/CVS/**,**/.svn/**"> - - -- -- -+ - - - only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6-docs.doc-base +++ tomcat6-6.0.16/debian/tomcat6-docs.doc-base @@ -0,0 +1,10 @@ +Document: tomcat6 +Title: Apache Tomcat 6.0 Documentation +Author: Apache Software Foundation +Abstract: Documentation bundle for Apache Tomcat 6.0 Servlet/JSP container. +Section: System/Administration + +Format: HTML +Index: /usr/share/doc/tomcat6-docs/docs/index.html +Files: /usr/share/doc/tomcat6-docs/docs/* + only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6-docs.postinst +++ tomcat6-6.0.16/debian/tomcat6-docs.postinst @@ -0,0 +1,17 @@ +#!/bin/sh -e + +#DEBHELPER# + +case "$1" in + configure) + if [ -z "$2" ]; then + # New installation, not a package upgrade + if [ -x /etc/init.d/tomcat6 ]; then + # Only restart tomcat if it is already running + if invoke-rc.d tomcat6 status >/dev/null; then + invoke-rc.d tomcat6 force-reload + fi + fi + fi + ;; +esac only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6-admin.postinst +++ tomcat6-6.0.16/debian/tomcat6-admin.postinst @@ -0,0 +1,17 @@ +#!/bin/sh -e + +#DEBHELPER# + +case "$1" in + configure) + if [ -z "$2" ]; then + # New installation, not a package upgrade + if [ -x /etc/init.d/tomcat6 ]; then + # Only restart tomcat if it is already running + if invoke-rc.d tomcat6 status >/dev/null; then + invoke-rc.d tomcat6 force-reload + fi + fi + fi + ;; +esac only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6.postrm +++ tomcat6-6.0.16/debian/tomcat6.postrm @@ -0,0 +1,46 @@ +#!/bin/sh -e + +#DEBHELPER# + +# Remove cached files and auto-generated catalina.policy +rm -rf /var/cache/tomcat6/* + +case "$1" in + remove) + # Remove ROOT webapp if not modified + RWLOC="/var/lib/tomcat6/webapps/ROOT" + RWFILES="$RWLOC/index.html $RWLOC/META-INF/context.xml" + if [ "`(cat $RWFILES | md5sum -) 2>/dev/null | cut -d ' ' -f 1`" \ + = "a8cd8f5f80f5a36b7565c0e8817f86a3" ] ; then + rm $RWFILES + rmdir --ignore-fail-on-non-empty \ + /var/lib/tomcat6/webapps/ROOT/META-INF \ + /var/lib/tomcat6/webapps/ROOT \ + /var/lib/tomcat6/webapps \ + /var/lib/tomcat6 || true + fi + if [ -d "/var/cache/tomcat6" ] ; then + rm -rf /var/cache/tomcat6 + fi + ;; + + purge) + # Remove user/group and log files (don't remove everything under + # /var/lib/tomcat6 because there might be user-installed webapps) + deluser tomcat6 || true + rm -rf /var/log/tomcat6 /var/lib/tomcat6/temp + if [ -d "/var/lib/tomcat6" ] ; then + rmdir --ignore-fail-on-non-empty /var/lib/tomcat6 || true + fi + rmdir --ignore-fail-on-non-empty /etc/tomcat6/policy.d /etc/tomcat6 || true + ;; + + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + # Nothing to do here + ;; + + *) + echo "$0 called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6-instance-create +++ tomcat6-6.0.16/debian/tomcat6-instance-create @@ -0,0 +1,51 @@ +#!/bin/sh +# Script to create a CATALINA_BASE directory for your own tomcat + +PROG=`basename $0` +usage() { + echo "Usage: $PROG " + echo " directoryname: name of the tomcat instance directory to create" +} + +if [ "$#" -eq 0 ]; then + usage + exit 0 +fi + +TARGET=$1 +if [ -d "${TARGET}" ]; then + echo "Target directory already exists." + exit 1 +fi + +mkdir -p ${TARGET} + +FULLTARGET=`cd ${TARGET}; pwd` + +mkdir ${TARGET}/conf +mkdir ${TARGET}/logs +mkdir ${TARGET}/lib +for jar in /usr/share/tomcat6/lib/*; do \ + ln -s $jar ${TARGET}/lib/`basename $jar`; done +mkdir ${TARGET}/webapps +mkdir ${TARGET}/work +mkdir ${TARGET}/temp +cp -r /usr/share/tomcat6/skel/* ${TARGET} + +cat > ${TARGET}/bin/startup.sh << EOT +#!/bin/sh +export CATALINA_BASE=${FULLTARGET} +/usr/share/tomcat6/bin/startup.sh +EOT + +cat > ${TARGET}/bin/shutdown.sh << EOT +#!/bin/sh +export CATALINA_BASE=${FULLTARGET} +/usr/share/tomcat6/bin/shutdown.sh +EOT + +chmod a+x ${TARGET}/bin/startup.sh ${TARGET}/bin/shutdown.sh +echo "* New Tomcat instance created in ${TARGET}" +echo "* You might need to change server ports in ${TARGET}/conf/server.xml" +echo " to avoid conflict with other services that might use them." +echo "* Run ${TARGET}/bin/startup.sh to start your Tomcat instance" only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6.links +++ tomcat6-6.0.16/debian/tomcat6.links @@ -0,0 +1,17 @@ +/etc/tomcat6 /var/lib/tomcat6/conf +/var/cache/tomcat6 /var/lib/tomcat6/work +/var/log/tomcat6 /var/lib/tomcat6/logs +/usr/share/tomcat6/lib/annotations-api.jar /var/lib/tomcat6/lib/annotations-api.jar +/usr/share/tomcat6/lib/catalina-ant.jar /var/lib/tomcat6/lib/catalina-ant.jar +/usr/share/tomcat6/lib/catalina-ha.jar /var/lib/tomcat6/lib/catalina-ha.jar +/usr/share/tomcat6/lib/catalina.jar /var/lib/tomcat6/lib/catalina.jar +/usr/share/tomcat6/lib/catalina-tribes.jar /var/lib/tomcat6/lib/catalina-tribes.jar +/usr/share/tomcat6/lib/commons-dbcp.jar /var/lib/tomcat6/lib/commons-dbcp.jar +/usr/share/tomcat6/lib/commons-pool.jar /var/lib/tomcat6/lib/commons-pool.jar +/usr/share/tomcat6/lib/el-api.jar /var/lib/tomcat6/lib/el-api.jar +/usr/share/tomcat6/lib/jasper-el.jar /var/lib/tomcat6/lib/jasper-el.jar +/usr/share/tomcat6/lib/jasper.jar /var/lib/tomcat6/lib/jasper.jar +/usr/share/tomcat6/lib/jasper-jdt.jar /var/lib/tomcat6/lib/jasper-jdt.jar +/usr/share/tomcat6/lib/jsp-api.jar /var/lib/tomcat6/lib/jsp-api.jar +/usr/share/tomcat6/lib/servlet-api.jar /var/lib/tomcat6/lib/servlet-api.jar +/usr/share/tomcat6/lib/tomcat-coyote.jar /var/lib/tomcat6/lib/tomcat-coyote.jar only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6.dirs +++ tomcat6-6.0.16/debian/tomcat6.dirs @@ -0,0 +1,4 @@ +var/log/tomcat6 +var/lib/tomcat6/temp +var/lib/tomcat6/webapps +var/cache/tomcat6 only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6.default +++ tomcat6-6.0.16/debian/tomcat6.default @@ -0,0 +1,28 @@ +# Run Tomcat as this user ID. Not setting this or leaving it blank will use the +# default of tomcat6. +#TOMCAT6_USER=tomcat6 + +# The home directory of the Java development kit (JDK). You need at least +# JDK version 1.5. If JAVA_HOME is not set, some common directories for +# OpenJDK, the Sun JDK, and various J2SE 1.5 versions are tried. +#JAVA_HOME=/usr/lib/jvm/openjdk-6-jdk + +# Directory for per-instance configuration files and webapps. It contains the +# directories conf, logs, webapps, work and temp. See RUNNING.txt for details. +# Default: /var/lib/tomcat6 +#CATALINA_BASE=/var/lib/tomcat6 + +# Arguments to pass to the Java virtual machine (JVM). +#JAVA_OPTS="-Djava.awt.headless=true -Xmx128M" + +# Java compiler to use for translating JavaServer Pages (JSPs). You can use all +# compilers that are accepted by Ant's build.compiler property. +#JSP_COMPILER=jikes + +# Use the Java security manager? (yes/no, default: yes) +# WARNING: Do not disable the security manager unless you understand +# the consequences! +#TOMCAT6_SECURITY=yes + +# Number of days to keep logfiles in /var/log/tomcat6. Default is 14 days. +#LOGFILE_DAYS=14 only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6.init +++ tomcat6-6.0.16/debian/tomcat6.init @@ -0,0 +1,216 @@ +#!/bin/sh +# +# /etc/init.d/tomcat6 -- startup script for the Tomcat 6 servlet engine +# +# Written by Miquel van Smoorenburg . +# Modified for Debian GNU/Linux by Ian Murdock . +# Modified for Tomcat by Stefan Gybas . +# Modified for Tomcat6 by Thierry Carrez . +# +### BEGIN INIT INFO +# Provides: tomcat +# Required-Start: $local_fs $remote_fs $network +# Required-Stop: $local_fs $remote_fs $network +# Should-Start: $named +# Should-Stop: $named +# Default-Start: 2 3 4 5 +# Default-Stop: 1 +# Short-Description: Start Tomcat. +# Description: Start the Tomcat servlet engine. +### END INIT INFO + +set -e + +PATH=/bin:/usr/bin:/sbin:/usr/sbin +NAME=tomcat6 +DESC="Tomcat servlet engine" +DAEMON=/usr/bin/jsvc +CATALINA_HOME=/usr/share/$NAME +DEFAULT=/etc/default/$NAME + +if [ `id -u` -ne 0 ]; then + echo "You need root privileges to run this script" + exit 1 +fi + +# Make sure tomcat is started with system locale +if [ -r /etc/default/locale ]; then + . /etc/default/locale + export LANG +fi + +. /lib/lsb/init-functions +. /etc/default/rcS + + +# The following variables can be overwritten in $DEFAULT + +# Run Tomcat 6 as this user ID +TOMCAT6_USER=tomcat6 + +# The first existing directory is used for JAVA_HOME (if JAVA_HOME is not +# defined in $DEFAULT) +JDK_DIRS="/usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun /usr/lib/jvm/java-1.5.0-sun /usr/lib/j2sdk1.5-sun /usr/lib/j2sdk1.5-ibm" + +# Look for the right JVM to use +for jdir in $JDK_DIRS; do + if [ -r "$jdir/bin/java" -a -z "${JAVA_HOME}" ]; then + JAVA_HOME="$jdir" + fi +done +export JAVA_HOME + +# Directory for per-instance configuration files and webapps +CATALINA_BASE=/var/lib/$NAME + +# Use the Java security manager? (yes/no) +TOMCAT6_SECURITY=yes + +# Default Java options +# Set java.awt.headless=true if JAVA_OPTS is not set so the +# Xalan XSL transformer can work without X11 display on JDK 1.4+ +# It also looks like the default heap size of 64M is not enough for most cases +# so the maximum heap size is set to 128M +if [ -z "$JAVA_OPTS" ]; then + JAVA_OPTS="-Djava.awt.headless=true -Xmx128M" +fi + +# End of variables that can be overwritten in $DEFAULT + +# overwrite settings from default file +if [ -f "$DEFAULT" ]; then + . "$DEFAULT" +fi + +if [ ! -f "$CATALINA_HOME/bin/bootstrap.jar" ]; then + log_failure_msg "$NAME is not installed" + exit 1 +fi + +if [ ! -f "$DAEMON" ]; then + log_failure_msg "missing $DAEMON" + exit 1 +fi + +POLICY_CACHE="$CATALINA_BASE/work/catalina.policy" + +JAVA_OPTS="$JAVA_OPTS -Djava.endorsed.dirs=$CATALINA_HOME/endorsed -Dcatalina.base=$CATALINA_BASE -Dcatalina.home=$CATALINA_HOME -Djava.io.tmpdir=$CATALINA_BASE/temp" + +# Set the JSP compiler if set in the tomcat6.default file +if [ -n "$JSP_COMPILER" ]; then + JAVA_OPTS="$JAVA_OPTS -Dbuild.compiler=$JSP_COMPILER" +fi + +if [ "$TOMCAT6_SECURITY" = "yes" ]; then + JAVA_OPTS="$JAVA_OPTS -Djava.security.manager -Djava.security.policy=$POLICY_CACHE" +fi + +# Set juli LogManager if logging.properties is provided +if [ -r "$CATALINA_BASE"/conf/logging.properties ]; then + JAVA_OPTS="$JAVA_OPTS "-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" "-Djava.util.logging.config.file="$CATALINA_BASE/conf/logging.properties" +fi + +# Define other required variables +CATALINA_PID="/var/run/$NAME.pid" +BOOTSTRAP_CLASS=org.apache.catalina.startup.Bootstrap +JSVC_CLASSPATH="/usr/share/java/commons-daemon.jar:$CATALINA_HOME/bin/bootstrap.jar" + +# Look for Java Secure Sockets Extension (JSSE) JARs +if [ -z "${JSSE_HOME}" -a -r "${JAVA_HOME}/jre/lib/jsse.jar" ]; then + JSSE_HOME="${JAVA_HOME}/jre/" +fi +export JSSE_HOME + +case "$1" in + start) + if [ -z "$JAVA_HOME" ]; then + log_failure_msg "no JDK found - please set JAVA_HOME" + exit 1 + fi + + if [ ! -d "$CATALINA_BASE/conf" ]; then + log_failure_msg "invalid CATALINA_BASE: $CATALINA_BASE" + exit 1 + fi + + log_daemon_msg "Starting $DESC" "$NAME" + if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \ + --user $TOMCAT6_USER --startas "$JAVA_HOME/bin/java" \ + >/dev/null; then + + # Regenerate POLICY_CACHE file + umask 022 + echo "// AUTO-GENERATED FILE from /etc/tomcat6/policy.d/" \ + > "$POLICY_CACHE" + echo "" >> "$POLICY_CACHE" + cat $CATALINA_BASE/conf/policy.d/*.policy \ + >> "$POLICY_CACHE" + + cd "$CATALINA_BASE/temp" + + $DAEMON -user "$TOMCAT6_USER" -cp "$JSVC_CLASSPATH" \ + -outfile SYSLOG -errfile SYSLOG \ + -pidfile "$CATALINA_PID" $JAVA_OPTS "$BOOTSTRAP_CLASS" + + sleep 5 + if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \ + --user $TOMCAT6_USER --startas "$JAVA_HOME/bin/java" \ + >/dev/null; then + log_end_msg 1 + else + log_end_msg 0 + fi + else + log_progress_msg "(already running)" + log_end_msg 0 + fi + ;; + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \ + --user "$TOMCAT6_USER" --startas "$JAVA_HOME/bin/java" \ + >/dev/null; then + log_progress_msg "(not running)" + else + $DAEMON -cp "$JSVC_CLASSPATH" -pidfile "$CATALINA_PID" \ + -stop "$BOOTSTRAP_CLASS" + fi + log_end_msg 0 + ;; + status) + if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \ + --user $TOMCAT6_USER --startas "$JAVA_HOME/bin/java" \ + >/dev/null; then + + if [ -f "$CATALINA_PID" ]; then + log_success_msg "$DESC is not running, but pid file exists." + else + log_success_msg "$DESC is not running." + fi + else + log_success_msg "$DESC is running with pid `cat $CATALINA_PID`" + fi + ;; + restart|force-reload) + if start-stop-daemon --test --stop --pidfile "$CATALINA_PID" \ + --user $TOMCAT6_USER --startas "$JAVA_HOME/bin/java" \ + >/dev/null; then + $0 stop + sleep 1 + fi + $0 start + ;; + try-restart) + if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \ + --user $TOMCAT6_USER --startas "$JAVA_HOME/bin/java" \ + >/dev/null; then + $0 start + fi + ;; + *) + log_success_msg "Usage: $0 {start|stop|restart|try-restart|force-reload|status}" + exit 1 + ;; +esac + +exit 0 only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6.install +++ tomcat6-6.0.16/debian/tomcat6.install @@ -0,0 +1,5 @@ +conf/catalina.properties /etc/tomcat6/ +debian/logging.properties /etc/tomcat6/ +conf/*.xml /etc/tomcat6/ +debian/policy/*.policy /etc/tomcat6/policy.d/ +debian/default_root /usr/share/tomcat6/webapps/ only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/logging.properties +++ tomcat6-6.0.16/debian/logging.properties @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler + +.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler + +############################################################ +# Handler specific properties. +# Describes specific configuration info for Handlers. +############################################################ + +1catalina.org.apache.juli.FileHandler.level = FINE +1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs +1catalina.org.apache.juli.FileHandler.prefix = catalina. + +2localhost.org.apache.juli.FileHandler.level = FINE +2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs +2localhost.org.apache.juli.FileHandler.prefix = localhost. + +java.util.logging.ConsoleHandler.level = FINE +java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter + +############################################################ +# Facility specific properties. +# Provides extra control for each logger. +############################################################ + +org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO +org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler + +# For example, set the com.xyz.foo logger to only log SEVERE +# messages: +#org.apache.catalina.startup.ContextConfig.level = FINE +#org.apache.catalina.startup.HostConfig.level = FINE +#org.apache.catalina.session.ManagerBase.level = FINE +#org.apache.catalina.core.AprLifecycleListener.level=FINE only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6-common.docs +++ tomcat6-6.0.16/debian/tomcat6-common.docs @@ -0,0 +1,2 @@ +RELEASE-NOTES +RUNNING.txt only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6-docs.postrm +++ tomcat6-6.0.16/debian/tomcat6-docs.postrm @@ -0,0 +1,11 @@ +#!/bin/sh -e + +#DEBHELPER# + +case "$1" in + remove) + if [ -x /etc/init.d/tomcat6 ]; then + invoke-rc.d tomcat6 try-restart || true + fi + ;; +esac only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6-instance-create.1 +++ tomcat6-6.0.16/debian/tomcat6-instance-create.1 @@ -0,0 +1,17 @@ +.TH "TOMCAT6-INSTANCE-CREATE" "1" "Aug 2008" "" "" +.SH "NAME" +tomcat6\-instance\-create \- create your own Tomcat6 instance +.SH "SYNOPSIS" +.B tomcat6\-instance\-create \fIdirectoryname\fR +.SH "DESCRIPTION" +This manual page documents the +.B tomcat6\-instance\-create +command. +.B tomcat6\-instance\-create +is a script that creates a directory with all required Tomcat6 CATALINA_BASE elements, allowing you to run a separate Tomcat 6 instance with its own configuration, libraries or web applications. It also creates bin/startup.sh and bin/shutdown.sh scripts to allow you to start and stop your instance. +.SH "PARAMETERS AND OPTIONS" +.TP +\fIdirectoryname\fR +The name of the directory to create your instance into. It should not exist, and will be created by tomcat6\-instance\-create. +.SH "AUTHOR" +This man page was written by Thierry Carrez and is copyright (C) 2008 Canonical Ltd. only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6-admin.postrm +++ tomcat6-6.0.16/debian/tomcat6-admin.postrm @@ -0,0 +1,11 @@ +#!/bin/sh -e + +#DEBHELPER# + +case "$1" in + remove) + if [ -x /etc/init.d/tomcat6 ]; then + invoke-rc.d tomcat6 try-restart || true + fi + ;; +esac only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6-examples.postinst +++ tomcat6-6.0.16/debian/tomcat6-examples.postinst @@ -0,0 +1,17 @@ +#!/bin/sh -e + +#DEBHELPER# + +case "$1" in + configure) + if [ -z "$2" ]; then + # New installation, not a package upgrade + if [ -x /etc/init.d/tomcat6 ]; then + # Only restart tomcat if it is already running + if invoke-rc.d tomcat6 status >/dev/null; then + invoke-rc.d tomcat6 force-reload + fi + fi + fi + ;; +esac only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6-common.install +++ tomcat6-6.0.16/debian/tomcat6-common.install @@ -0,0 +1,2 @@ +output/build/bin/* /usr/share/tomcat6/bin/ +bin/* /usr/share/tomcat6/bin/ only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6-examples.postrm +++ tomcat6-6.0.16/debian/tomcat6-examples.postrm @@ -0,0 +1,11 @@ +#!/bin/sh -e + +#DEBHELPER# + +case "$1" in + remove) + if [ -x /etc/init.d/tomcat6 ]; then + invoke-rc.d tomcat6 try-restart || true + fi + ;; +esac only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6-examples.install +++ tomcat6-6.0.16/debian/tomcat6-examples.install @@ -0,0 +1,3 @@ +debian/context/examples.xml /etc/tomcat6/Catalina/localhost/ +output/build/webapps/examples /usr/share/tomcat6-examples/ +debian/policy/examples/*.policy /etc/tomcat6/policy.d/ only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6.cron.daily +++ tomcat6-6.0.16/debian/tomcat6.cron.daily @@ -0,0 +1,21 @@ +#!/bin/sh + +NAME=tomcat6 +DEFAULT=/etc/default/$NAME + +# The following variables can be overwritten in $DEFAULT + +# Default for number of days to keep old log files in /var/log/tomcatN/ +LOGFILE_DAYS=14 + +# End of variables that can be overwritten in $DEFAULT + +# overwrite settings from default file +if [ -f "$DEFAULT" ]; then + . "$DEFAULT" +fi + +if [ -d /var/log/$NAME ]; then + find /var/log/$NAME/ -name \*.log -mtime +$LOGFILE_DAYS -print0 \ + | xargs --no-run-if-empty -0 rm -- +fi only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6-docs.install +++ tomcat6-6.0.16/debian/tomcat6-docs.install @@ -0,0 +1,2 @@ +debian/context/docs.xml /etc/tomcat6/Catalina/localhost/ +output/build/webapps/docs /usr/share/tomcat6-docs/ only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6-docs.links +++ tomcat6-6.0.16/debian/tomcat6-docs.links @@ -0,0 +1 @@ +/usr/share/tomcat6-docs/docs /usr/share/doc/tomcat6-docs/docs only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6-common.links +++ tomcat6-6.0.16/debian/tomcat6-common.links @@ -0,0 +1,6 @@ +/usr/share/java/commons-dbcp.jar /usr/share/tomcat6/lib/commons-dbcp.jar +/usr/share/java/commons-pool.jar /usr/share/tomcat6/lib/commons-pool.jar +/usr/share/java/el-api-2.1.jar /usr/share/tomcat6/lib/el-api.jar +/usr/share/java/ecj.jar /usr/share/tomcat6/lib/jasper-jdt.jar +/usr/share/java/jsp-api-2.1.jar /usr/share/tomcat6/lib/jsp-api.jar +/usr/share/java/servlet-api-2.5.jar /usr/share/tomcat6/lib/servlet-api.jar only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6.postinst +++ tomcat6-6.0.16/debian/tomcat6.postinst @@ -0,0 +1,21 @@ +#!/bin/sh -e + +case "$1" in + configure) + if ! id tomcat6 > /dev/null 2>&1 ; then + adduser --system --home /usr/share/tomcat6 --no-create-home \ + --group --disabled-password --shell /bin/false \ + tomcat6 + fi + chown -R tomcat6:adm /var/log/tomcat6 /var/cache/tomcat6 + chmod 750 /var/log/tomcat6 /var/cache/tomcat6 + chgrp tomcat6 /etc/tomcat6/tomcat-users.xml + chmod 640 /etc/tomcat6/tomcat-users.xml + ;; +esac + +if [ ! -d /var/lib/tomcat6/webapps/ROOT ]; then + cp -r /usr/share/tomcat6/webapps/default_root /var/lib/tomcat6/webapps/ROOT +fi + +#DEBHELPER# only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/libservlet2.5-java.install +++ tomcat6-6.0.16/debian/libservlet2.5-java.install @@ -0,0 +1,3 @@ +output/build/lib/servlet-api-2.5.jar /usr/share/java +output/build/lib/jsp-api-2.1.jar /usr/share/java +output/build/lib/el-api-2.1.jar /usr/share/java only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6-user.install +++ tomcat6-6.0.16/debian/tomcat6-user.install @@ -0,0 +1,5 @@ +conf/*.xml /usr/share/tomcat6/skel/conf/ +conf/catalina.properties /usr/share/tomcat6/skel/conf/ +debian/logging.properties /usr/share/tomcat6/skel/conf/ +debian/tomcat6-instance-create /usr/bin/ +debian/setenv.sh /usr/share/tomcat6/skel/bin/ only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/setenv.sh +++ tomcat6-6.0.16/debian/setenv.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# + +CATALINA_HOME=/usr/share/tomcat6 + +# The first existing directory is used for JAVA_HOME (if JAVA_HOME is not +# defined in $DEFAULT) +JDK_DIRS="/usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun /usr/lib/jvm/java-1.5.0-sun /usr/lib/j2sdk1.5-sun /usr/lib/j2sdk1.5-ibm" + +# Look for the right JVM to use +for jdir in $JDK_DIRS; do + if [ -r "$jdir/bin/java" -a -z "${JAVA_HOME}" ]; then + JAVA_HOME_TMP="$jdir" + # checks for a real JDK like environment, needed to check if + # really the java-gcj-compat-dev package is installed + if [ -r "$jdir/bin/jdb" ]; then + JAVA_HOME="$JAVA_HOME_TMP" + fi + fi +done + +# Default Java options +if [ -z "$JAVA_OPTS" ]; then + JAVA_OPTS="-Djava.awt.headless=true -Xmx128M" +fi + only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/tomcat6-admin.install +++ tomcat6-6.0.16/debian/tomcat6-admin.install @@ -0,0 +1,4 @@ +debian/context/manager.xml /etc/tomcat6/Catalina/localhost/ +output/build/webapps/manager /usr/share/tomcat6-admin/ +debian/context/host-manager.xml /etc/tomcat6/Catalina/localhost/ +output/build/webapps/host-manager /usr/share/tomcat6-admin/ only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/patches/series +++ tomcat6-6.0.16/debian/patches/series @@ -0,0 +1,2 @@ +CVE-2008-1947.patch +deploy-webapps-build-xml.patch only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/patches/deploy-webapps-build-xml.patch +++ tomcat6-6.0.16/debian/patches/deploy-webapps-build-xml.patch @@ -0,0 +1,37 @@ +Index: apache-tomcat-6.0.16-src/build.xml +=================================================================== +--- apache-tomcat-6.0.16-src.orig/build.xml 2008-07-25 09:31:17.000000000 +0200 ++++ apache-tomcat-6.0.16-src/build.xml 2008-07-25 09:32:21.000000000 +0200 +@@ -466,7 +466,7 @@ + + + +- ++ + + +@@ -489,6 +489,13 @@ + + + ++ ++ ++ ++ ++ ++ ++ + + + +@@ -599,9 +606,6 @@ + + + +- +- +- + + + + + only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/context/manager.xml +++ tomcat6-6.0.16/debian/context/manager.xml @@ -0,0 +1,20 @@ + + + only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/context/examples.xml +++ tomcat6-6.0.16/debian/context/examples.xml @@ -0,0 +1,2 @@ + only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/context/docs.xml +++ tomcat6-6.0.16/debian/context/docs.xml @@ -0,0 +1,20 @@ + + + only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/default_root/index.html +++ tomcat6-6.0.16/debian/default_root/index.html @@ -0,0 +1,29 @@ + + + + + Apache Tomcat + + + +

It works !

+ +

If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations!

+ +

This is the default Tomcat home page. It can be found on the local filesystem at: /var/lib/tomcat6/webapps/ROOT/index.html

+ +

Tomcat6 veterans might be pleased to learn that this system instance of Tomcat is installed with CATALINA_HOME in /usr/share/tomcat6 and CATALINA_BASE in /var/lib/tomcat6, following the rules from /usr/share/doc/tomcat6-common/RUNNING.txt.gz.

+ +

You might consider installing the following packages, if you haven't already done so:

+ +

tomcat6-docs: This package installs a web application that allows to browse the Tomcat 6 documentation locally. Once installed, you can access it by clicking here.

+ +

tomcat6-examples: This package installs a web application that allows to access the Tomcat 6 Servlet and JSP examples. Once installed, you can access it by clicking here.

+ +

tomcat6-admin: This package installs two web applications that can help managing this Tomcat instance. Once installed, you can access the manager webapp and the host-manager webapp.

+ +

NOTE: For security reasons, using the manager webapp is restricted to users with role "manager". The host-manager webapp is restricted to users with role "admin". Users are defined in /etc/tomcat6/tomcat-users.xml. To create new virtual hosts with the host-manager webapp, you might also need to allow the tomcat6 user to write in the /etc/tomcat6/Catalina directory, this is not allowed by default.

+ + + only in patch2: unchanged: --- tomcat6-6.0.16.orig/debian/default_root/META-INF/context.xml +++ tomcat6-6.0.16/debian/default_root/META-INF/context.xml @@ -0,0 +1,2 @@ +