
Documentation for Crowd 2.0.x. Documentation for other versions of Crowd is available too.
This page contains some useful information about running Crowd under Linux/UNIX:
Here is an example of some of the changes you can make to harden up the directory and file permissions for Crowd to run as a non-root user.
You will need to update the environment variables to suit your installation. This is also for use in BASH. If you are using a different shell, you might need to tweak some things.
#!/bin/bash
CROWD_USER="crowd"
CROWD_GROUP="crowd"
INSTALL_BASE="/opt/crowd/atlassian-crowd-2.0.3"
CROWD_HOME="/opt/crowd/crowd-home"
sudo chgrp ${CROWD_GROUP} ${INSTALL_BASE}/apache-tomcat/{logs,work,bin/{catalina,startup,shutdown,setclasspath}.sh}
sudo chmod g+x ${INSTALL_BASE}/apache-tomcat/bin/{catalina,startup,shutdown,setclasspath}.sh
sudo chmod g+w ${INSTALL_BASE}/apache-tomcat/{logs,work}
sudo chmod -R g+w ${CROWD_HOME}
init.d file (for example, 'crowd.init.d') inside your {CROWD_INSTALL} directory:
#!/bin/bash
# Crowd startup script
#chkconfig: 2345 80 05
#description: Crowd
# Based on script at http://www.bifrost.org/problems.html
RUN_AS_USER=crowd
CATALINA_HOME=/opt/crowd/apache-tomcat
start() {
echo "Starting Crowd: "
if [ "x$USER" != "x$RUN_AS_USER" ]; then
su - $RUN_AS_USER -c "$CATALINA_HOME/bin/startup.sh"
else
$CATALINA_HOME/bin/startup.sh
fi
echo "done."
}
stop() {
echo "Shutting down Crowd: "
if [ "x$USER" != "x$RUN_AS_USER" ]; then
su - $RUN_AS_USER -c "$CATALINA_HOME/bin/shutdown.sh"
else
$CATALINA_HOME/bin/shutdown.sh
fi
echo "done."
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 10
#echo "Hard killing any remaining threads.."
#kill -9 `cat $CATALINA_HOME/work/catalina.pid`
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
exit 0
/etc/init.d/crowd to the init.d file file.Hint for Red Hat systems
On Red Hat and Red Hat-based systems such as CentOS, if you put the above script in /etc/init.d, you can create the necessary symbolic links with the chkconfig script, since all the rrequired information is in the script header.
sudo /sbin/chkconfig --add SCRIPT_NAME
Replace "SCRIPT_NAME" with whatever the real name of the script is.
情報を提供して頂きありがとうございました
このページの情報源を提供してくれた Matthew Block と Pete Toscano に感謝します。