This page last changed on Aug 29, 2011 by edawson.
On Linux/Solaris, 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 Linux/Solaris:
- 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:
- Edit <<CONFLUENCE_INSTALL_DIRECTORY>>/confluence/WEB-INF/classes/confluence-init.properties file, and set confluence.home=/usr/local/confluence/<Confluence_Data_Home> (ensure you have removed the comment '#')
- 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/sh -e
# Confluence startup script
#chkconfig: 2345 80 05
#description: Confluence
# Define some variables
# Name of app ( JIRA, Confluence, etc )
APP=confluence
# Name of the user to run as
USER=confluence
# Location of application's bin directory
CATALINA_HOME=/usr/local/confluence/current
# Location of Java JDK
export JAVA_HOME=/usr/lib/jvm/java-6-sun
case "$1" in
# Start command
start)
echo "Starting $APP"
/bin/su -m $USER -c "$CATALINA_HOME/bin/startup.sh &> /dev/null"
;;
# Stop command
stop)
echo "Stopping $APP"
/bin/su -m $USER -c "$CATALINA_HOME/bin/shutdown.sh &> /dev/null"
echo "$APP stopped successfully"
;;
# Restart command
restart)
$0 stop
sleep 5
$0 start
;;
*)
echo "Usage: /etc/init.d/$APP {start|restart|stop}"
exit 1
;;
esac
exit 0
- Make this file executable:
- Set this file to run at the appropriate runleve. For example, use
sudo chkconfig --add confluence 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>:8090/
The port for this will be whatever is defined in your Confluence server.xml file.
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 .
- Karmic and later: Create two text files in
/etc/init/ called confluence-up.conf and confluence-down.conf :
confluence-up :
confluence-down :
... and make them readable to all users:
sudo chmod a+r /etc/init/confluence-up.conf /etc/init/confluence-down.conf
- Jaunty, Intrepid: Create two text files in
/etc/event.d/ called confluence-up and confluence-down :
confluence-up :
confluence-down :
... and make them readable to all users:
sudo chmod a+r /etc/event.d/confluence-up /etc/event.d/confluence-down
Start Confluence Automatically on System Startup
|