r1815 - crux-2.2/ports/opt/apache-tomcat
Author: sip Date: 2006-09-05 10:08:12 +0200 (Tue, 05 Sep 2006) New Revision: 1815 Added: crux-2.2/ports/opt/apache-tomcat/pre-install Modified: crux-2.2/ports/opt/apache-tomcat/.footprint crux-2.2/ports/opt/apache-tomcat/.md5sum crux-2.2/ports/opt/apache-tomcat/Pkgfile crux-2.2/ports/opt/apache-tomcat/README crux-2.2/ports/opt/apache-tomcat/tomcat Log: apache-tomcat: run as tomcat user. see README Modified: crux-2.2/ports/opt/apache-tomcat/.footprint =================================================================== --- crux-2.2/ports/opt/apache-tomcat/.footprint 2006-09-05 07:44:37 UTC (rev 1814) +++ crux-2.2/ports/opt/apache-tomcat/.footprint 2006-09-05 08:08:12 UTC (rev 1815) @@ -16,6 +16,7 @@ -rw-r--r-- root/root usr/lib/tomcat/bin/jmxaccessor-tasks.xml -rw-r--r-- root/root usr/lib/tomcat/bin/jsvc.tar.gz -rwxr-xr-x root/root usr/lib/tomcat/bin/setclasspath.sh +-rwxr-xr-x root/root usr/lib/tomcat/bin/setenv.sh -rwxr-xr-x root/root usr/lib/tomcat/bin/shutdown.sh -rwxr-xr-x root/root usr/lib/tomcat/bin/startup.sh -rw-r--r-- root/root usr/lib/tomcat/bin/tomcat-juli.jar @@ -43,17 +44,17 @@ drwxr-xr-x root/root usr/lib/tomcat/conf/ drwxr-xr-x root/root usr/lib/tomcat/conf/Catalina/ drwxr-xr-x root/root usr/lib/tomcat/conf/Catalina/localhost/ --rw------- root/root usr/lib/tomcat/conf/Catalina/localhost/host-manager.xml --rw------- root/root usr/lib/tomcat/conf/Catalina/localhost/manager.xml --rw------- root/root usr/lib/tomcat/conf/catalina.policy --rw------- root/root usr/lib/tomcat/conf/catalina.properties --rw------- root/root usr/lib/tomcat/conf/context.xml --rw------- root/root usr/lib/tomcat/conf/logging.properties --rw------- root/root usr/lib/tomcat/conf/server-minimal.xml --rw------- root/root usr/lib/tomcat/conf/server.xml --rw------- root/root usr/lib/tomcat/conf/tomcat-users.xml --rw------- root/root usr/lib/tomcat/conf/web.xml -drwxr-xr-x root/root usr/lib/tomcat/logs/ +-rw-r----- root/tomcat usr/lib/tomcat/conf/Catalina/localhost/host-manager.xml +-rw-r----- root/tomcat usr/lib/tomcat/conf/Catalina/localhost/manager.xml +-rw-r----- root/tomcat usr/lib/tomcat/conf/catalina.policy +-rw-r----- root/tomcat usr/lib/tomcat/conf/catalina.properties +-rw-r----- root/tomcat usr/lib/tomcat/conf/context.xml +-rw-r----- root/tomcat usr/lib/tomcat/conf/logging.properties +-rw-r----- root/tomcat usr/lib/tomcat/conf/server-minimal.xml +-rw-r----- root/tomcat usr/lib/tomcat/conf/server.xml +-rw-r----- root/tomcat usr/lib/tomcat/conf/tomcat-users.xml +-rw-r----- root/tomcat usr/lib/tomcat/conf/web.xml +drwxr-xr-x tomcat/tomcat usr/lib/tomcat/logs/ drwxr-xr-x root/root usr/lib/tomcat/server/ drwxr-xr-x root/root usr/lib/tomcat/server/classes/ drwxr-xr-x root/root usr/lib/tomcat/server/lib/ @@ -117,7 +118,7 @@ drwxr-xr-x root/root usr/lib/tomcat/shared/ drwxr-xr-x root/root usr/lib/tomcat/shared/classes/ drwxr-xr-x root/root usr/lib/tomcat/shared/lib/ -drwxr-xr-x root/root usr/lib/tomcat/temp/ +drwxr-xr-x tomcat/tomcat usr/lib/tomcat/temp/ -rw-r--r-- root/root usr/lib/tomcat/temp/bugzilla37035-safeToDelete.tmp (EMPTY) drwxr-xr-x root/root usr/lib/tomcat/webapps/ drwxr-xr-x root/root usr/lib/tomcat/webapps/ROOT/ Modified: crux-2.2/ports/opt/apache-tomcat/.md5sum =================================================================== --- crux-2.2/ports/opt/apache-tomcat/.md5sum 2006-09-05 07:44:37 UTC (rev 1814) +++ crux-2.2/ports/opt/apache-tomcat/.md5sum 2006-09-05 08:08:12 UTC (rev 1815) @@ -1,2 +1,2 @@ 994d39c0d2f462c79288e0249991dd49 apache-tomcat-5.5.17.tar.gz -2eb91361638de7dcaa970af2e7f26652 tomcat +6a4fee28c02ed61727e696193569b91e tomcat Modified: crux-2.2/ports/opt/apache-tomcat/Pkgfile =================================================================== --- crux-2.2/ports/opt/apache-tomcat/Pkgfile 2006-09-05 07:44:37 UTC (rev 1814) +++ crux-2.2/ports/opt/apache-tomcat/Pkgfile 2006-09-05 08:08:12 UTC (rev 1815) @@ -20,7 +20,23 @@ rm $PKG/usr/lib/tomcat/{RUNNING.txt,LICENSE,RELEASE-NOTES} find $PKG -name *.bat|xargs rm -f find $PKG -name *.exe|xargs rm -f - mkdir -p $PKG/etc/rc.d install -m 755 tomcat $PKG/etc/rc.d + + # Adjust for non-root setup + chown tomcat.tomcat $PKG/usr/lib/tomcat/logs + chown tomcat.tomcat $PKG/usr/lib/tomcat/temp + + for f in $PKG/usr/lib/tomcat/conf/*.* $PKG/usr/lib/tomcat/conf/Catalina/localhost/*; do + chown root.tomcat $f + chmod 640 $f + done + + cat << EOF > $PKG/usr/lib/tomcat/bin/setenv.sh +#!/bin/sh +# Setup envirnoment variables for tomcat +export JAVA_HOME=/usr/lib/java +EOF + + chmod 755 $PKG/usr/lib/tomcat/bin/setenv.sh } Modified: crux-2.2/ports/opt/apache-tomcat/README =================================================================== --- crux-2.2/ports/opt/apache-tomcat/README 2006-09-05 07:44:37 UTC (rev 1814) +++ crux-2.2/ports/opt/apache-tomcat/README 2006-09-05 08:08:12 UTC (rev 1815) @@ -1,19 +1,30 @@ README file for apache-tomcat port -CAUTION -This port is best suited for a test / developement environment; -you should really use a dedicated local user for running the -tomcat server on a production environment. +NOTES FOR 5.5.17-2 + The port 5.5.17-2 introduces a couple of relevant changes: + + - Tomcat now runs under a 'tomcat' user instead of root. + You may need to adjust permissions on custom config files + under $TOMCAT_DIR/conf if you have created any. + - The JAVA_HOME variable is now set in $TOMCAT_DIR/bin/setenv.sh, + which is read by tomcat startup/shutdown scripts. +PRE-INSTALL + Execute the pre-install script, or manually add a 'tomcat' + user and group. + NOTES -Starting from the 5.5.x series the default tomcat installation -requires Java 1.5; compatibilities addons are available, feel -free to provide them as a separate addon port. + Starting from the 5.5.x series the default tomcat installation + requires Java 1.5; compatibilities addons are available, feel + free to provide them as a separate addon port. -The web administration interface is also removed from the -standard installation; again, if needed please provide it -through a dedicated port to avoid adding unnecessary stuff here. + The web administration interface is also removed from the + standard installation; again, if needed please provide it + through a dedicated port to avoid adding unnecessary stuff here. POST-INSTALL -Set up your JAVA_HOME environment variable -pointing to j2sdk installation path (ie in /etc/profile) + Set up a manager user/role in, $TOMCAT_HOME/conf/tomcat-users.xml, + ie: + <tomcat-users> + <user name="manager" password="verysecret" roles="manager" /> + </tomcat-users> Added: crux-2.2/ports/opt/apache-tomcat/pre-install =================================================================== --- crux-2.2/ports/opt/apache-tomcat/pre-install (rev 0) +++ crux-2.2/ports/opt/apache-tomcat/pre-install 2006-09-05 08:08:12 UTC (rev 1815) @@ -0,0 +1,12 @@ +#!/bin/sh + +gr=`grep tomcat /etc/group` +if [ "$gr" = "" ]; then + groupadd tomcat +fi + +us=`grep tomcat /etc/passwd` +if [ "$us" = "" ]; then + useradd -s /bin/bash -g tomcat tomcat + passwd -l tomcat +fi Property changes on: crux-2.2/ports/opt/apache-tomcat/pre-install ___________________________________________________________________ Name: svn:executable + * Modified: crux-2.2/ports/opt/apache-tomcat/tomcat =================================================================== --- crux-2.2/ports/opt/apache-tomcat/tomcat 2006-09-05 07:44:37 UTC (rev 1814) +++ crux-2.2/ports/opt/apache-tomcat/tomcat 2006-09-05 08:08:12 UTC (rev 1815) @@ -5,14 +5,15 @@ case "$1" in start) - /usr/lib/tomcat/bin/startup.sh + su - tomcat -c /usr/lib/tomcat/bin/startup.sh ;; stop) - /usr/lib/tomcat/bin/shutdown.sh + su - tomcat -c /usr/lib/tomcat/bin/shutdown.sh ;; restart) - /usr/lib/tomcat/bin/shutdown.sh - /usr/lib/tomcat/bin/startup.sh + su - tomcat -c /usr/lib/tomcat/bin/shutdown.sh + sleep 4 + su - tomcat -c /usr/lib/tomcat/bin/startup.sh ;; *) echo "usage: $0 start|stop|restart"
participants (1)
-
crux@crux.nu