May 25, 2017

How to Install Confluence on CentOS

Confluence Logo

We think Confluence (developed and marketed by Atlassian) is the best enterprise wiki out there. It has a plugin system and is very easy to configure. Confluence is written in Java and is mainly used in corporate environments. This instruction is to install Confluence on CentOS. We are using Confluence on CentOS 6 with 64 bit. Please change the paths when it is required.

Root access is required to edit the following files and to execute commands. Log in as root (su) or simply prepend sudo to all commands that require root privileges.

Install Java JDK and needed libraries

Confluence needs the Java JDK package and some libraries.

yum update
cd /tmp/
wget http://download.oracle.com/otn-pub/java/jdk/6u31-b04/jdk-6u31-linux-x64.bin
mv jdk* jdk-6.bin
chmod +x jdk-6.bin
./jdk-6.bin
mkdir /usr/lib/java
mv jdk1.6*/ /usr/lib/java/
yum install libICE-devel libSM-devel libX11-devel libXp-devel libXt-devel libXtst-devel libXext-devel

Install Confluence

Download the latest Confluence release.

cd /tmp
wget http://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-4.1.7.tar.gz

Add the confluence user.

useradd --create-home -c "Confluence role account" confluence

Create and move into the confluence directory.

mkdir -p /opt/confluence
cd /opt/confluence/

Decompress Confluence, link to current and set the ownership.

tar xvzf /tmp/atlassian-confluence-4.1.7.tar.gz
ln -s atlassian-confluence-4.1.7/ current
chown -R confluence: /opt/confluence

Add the Confluence home directory.

vi /opt/confluence/current/confluence/WEB-INF/classes/confluence-init.properties
confluence.home=/opt/confluence/home

Create the Confluence start script.

vi /etc/init.d/confluence

Add the following lines to the Confluence start script file.

#!/bin/sh
#
# Confluence start/stop script.
#
# chkconfig: - 85 15
# description: Confluence is a wiki system.

# Source function library.
. /etc/rc.d/init.d/functions

case "$1" in
    start)
        su - confluence -c /opt/confluence/atlassian-confluence-4.1.7/bin/startup.sh
        retval=$?
        ;;

    stop)
        su - confluence -c /opt/confluence/atlassian-confluence-4.1.7/bin/shutdown.sh
        retval=$?
        ;;

    restart)
        su - confluence -c /opt/confluence/atlassian-confluence-4.1.7/bin/shutdown.sh
        su - confluence -c /opt/confluence/atlassian-confluence-4.1.7/bin/startup.sh
        ;;

esac
exit $retval

Set the ownership and add the start script to your chkconfig.

chmod +x /etc/init.d/confluence
chkconfig --add confluence
chkconfig confluence on

Feel free to change the Server and Connector port. The default port is 8090

vi /opt/confluence/current/conf/server.xml

Let Confluence know the Java JDK path.

vi /opt/confluence/atlassian-confluence-4.1.7/bin/setenv.sh

Add the path on the top of this file.

JAVA_HOME="/usr/lib/java/jdk1.6.0_31"
export JAVA_HOME

Now, we can start Confluence.

/etc/init.d/confluence start

The log file is located here:

less /opt/confluence/current/logs/catalina.out

Create the Confluence database

Log into MySQL as root and create the Confluence database. Replace PASSWORD with the password you want to use for the confluence database user.

mysql -u root -p
create database confluence character set utf8;
grant all privileges on confluence.* to confluence@localhost identified by 'PASSWORD' with grant option;
flush privileges;
quit

Type in your server IP followed by the port number to see the Confluence setup.

http://123.123.123.123:8090

Enter your licence key, choose Custom Installation, select MySQL, click on External Database and then click on Direct JDBC. Add the following JDBC path and enter your Confluence database user and password.

jdbc:mysql://localhost:3306/confluence?autoReconnect=true
User: confluence
Password: PASSWORD

Restart Confluence for the changes to take effect.

/etc/init.d/confluence restart

Now. you can continue with the Confluence setup.

Comments

  1. Great post, really enjoyed it!
    — Eda

  2. vikramgorla says:

    Due to change in Oracle website adding cookie policy, wget in step 1 should have additional parameters as below:

    wget –no-check-certificate –no-cookies –header “Cookie: oraclelicense=accept-securebackup-cookie” http://download.oracle.com/otn-pub/java/jdk/6u31-b04/jdk-6u31-linux-x64.bin

Speak Your Mind