This page last changed on Sep 07, 2009 by ggaskell.
On Unix/Linux, the best practice is to install, configure and run each service (including Confluence) as a dedicated user with only the permissions they require.
To install, configure and run Confluence automatically on Unix/Linux:
- Create a confluence user for instance, using the following command:
- Create a directory to install Confluence into:
- Log in as the confluence user to install Confluence:
- Then back as root, create the file /etc/init.d/confluence (code shown below), which will be responsible for starting up Confluence after a reboot (or when manually invoked).
If you are running Ubuntu Jaunty (or later) do not perform this step. Please use the instructions further down this page.
#!/bin/bash
# Confluence startup script
#chkconfig: 2345 80 05
#description: Confluence
# Based on script at http://www.bifrost.org/problems.html
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 this file executable:
- Set this file to run at the appropriate runleve. For example, 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 output typically looks like this:
You should then see this running at http://<server>:8080/.
Adding Confluence as a service for Ubuntu Jaunty (or later)
To continue configuring Confluence to start automatically as a service on Ubuntu Jaunty (or later):
- After logging in as the confluence user to install Confluence, create start and stop scripts in /usr/local/confluence:
Example start script:
Example stop script:
- Make both of these scripts executable. For example, by issuing the command: sudo chmod a+x /usr/local/confluence/start /usr/local/confluence/stop.
- Create two text files in /etc/event.d/ called confluence-up and confluence-down:
confluence-up:
confluence-down:
RELATED TOPICS
Start Confluence automatically on system startup
|