This page last changed on Feb 26, 2008 by jeff.
On Unix, best practice is to install each service (like Confluence) running as a dedicated user who has only the required permissions. For instance, you could create a confluence user with:
Then create a directory to install Confluence into:
and log in as the confluence user to install Confluence:
Then back as root, create the file /etc/init.d/confluence, which will be responsible for starting up Confluence after a reboot (or when manually invoked):
#!/bin/bash
# Confluence startup script
# Based on script at http:
RUN_AS_USER=confluence
CATALINA_HOME=/usr/local/confluence/current
start() {
echo "Starting Confluence: "
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 Confluence: "
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
Make sure it is executable:
and set it to run at the appropriate runlevel (use sudo ntsysv on Redhat-based systems, sudo update-rc.d confluence defaults or rcconf on Debian-based systems).
You should now be able to start Confluence with the init script. A successful startup looks like this:
You should then see it running at http://<server>:8080/.
Related Topics
Start Confluence automatically on system startup
|