Confluence 5.6 has reached end of life
Check out the [latest version] of the documentation
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:
sudo useradd --create-home -c "Confluence role account" confluence
Create a directory to install Confluence into:
sudo mkdir /usr/local/confluence sudo chown confluence: /usr/local/confluence
Log in as the confluence user to install Confluence:
sudo su - confluence cd /usr/local/confluence/ tar zxvf /tmp/confluence-3.0.1-std.tar.gz ln -s confluence-3.0.1-std/ current
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:
sudo chmod +x /etc/init.d/confluence
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:
$ sudo /etc/init.d/confluence start Starting Confluence: If you encounter issues starting up Confluence, please see the Installation guide at http://confluence.atlassian.com/display/DOC/Confluence+Installation+Guide Using CATALINA_BASE: /usr/local/confluence/current Using CATALINA_HOME: /usr/local/confluence/current Using CATALINA_TMPDIR: /usr/local/confluence/current/temp Using JRE_HOME: /usr/lib/jvm/java-1.5.0-sun done.
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.
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 startscript:
#!/bin/bash export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.16/ export JDK_HOME=/usr/lib/jvm/java-6-sun-1.6.0.16/ cd /usr/local/confluence/current/bin ./startup.sh
Example stopscript:
#!/bin/bash export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.16/ export JDK_HOME=/usr/lib/jvm/java-6-sun-1.6.0.16/ cd /usr/local/confluence/current/bin ./shutdown.sh
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:
start on runlevel [2345] script date >> /tmp/confluence-startup.out exec sudo -u confluence /usr/local/confluence/start >> /tmp/confluence-startup.out 2>&1 end script
confluence-down:
start on runlevel [16] expect fork respawn exec sudo -u confluence /usr/local/confluence/stop >> /tmp/confluence-shutdown.out 2>&1
... 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:
start on runlevel 2 start on runlevel 3 start on runlevel 4 start on runlevel 5 exec sudo -u confluence /usr/local/confluence/start >> /tmp/confluence-startup.out 2>&1
confluence-down:
start on runlevel 1 start on runlevel 6 exec sudo -u confluence /usr/local/confluence/stop >> /tmp/confluence-shutdown.out 2>&1
... and make them readable to all users:
sudo chmod a+r /etc/event.d/confluence-up /etc/event.d/confluence-down