Page tree
Skip to end of metadata
Go to start of metadata

Note

This is a stripped-down version of Installing Confluence on Linux from Archive File with info from other pages placed in line.

Obtain a License

Visit http://my.atlassian.com/ and set up and account and purchase a 10 user license (using a credit card). Fill in all the needed info regarding technical and business contacts (this can be updated later). This is the account you will use to admin licenses and submit support requests (can also be done via the Confluence Admin console.

Keep the key handy.

Install Java

  1. Download and install Java: http://www.oracle.com/technetwork/java/javase/downloads/server-jre8-downloads-2133154.html
  2. Type echo $JAVA_HOME in the shell console and then press Enter to verify the install and note the path

Note

The path will be used later to update the sentenv.sh

Download and Extract the Confluence Installation File

Suggested directory structure

Atlassian's documentation is a bit vague. Here is a suggested structure:

DIrPath
Home (data)/opt/atlassian/confluence
Install/opt/atlassian/install/atlassian-confluence-5.9.4

Set up the install and home directories

[root@cebu lib]# cd /opt
[root@cebu opt]# mkdir atlassian
[root@cebu opt]# cd atlassian
[root@cebu atlassian]# mkdir install
[root@cebu atlassian]# mkdir confluence

Download file to the install directory and untar

wget https://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-5.9.4.tar.gz
gunzip atlassian-confluence-5.9.4.tar.gz
tar -xf atlassian-confluence-5.9.4.tar 

Set Home Directory

DIrPathReference in this Cheatsheet
Home (data)/opt/atlassian/confluence 
Install/opt/atlassian/install/atlassian-confluence-5.9.4<confluence-install-dir>

Under the Installation directory, find this file: <confluence-install-dir>  and set:

confluence.home=/opt/atlassian/confluence

Set Path to Java

The variable JRE_HOME needs to be set in the file <confluence-install-dir>/bin/setenv.sh.  Add the following line to point to the Java installation, for example:

JRE_HOME="/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.85-2.6.1.2.el7_1.x86_64"; export JRE_HOME

Open the Ports on the Firewall

Don't know if this applies to Ubuntu, but external browser access is needed to the server. 8090 is the default port, which we will later changed to 80.

firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=8090/tcp --permanent

Reload the settings

firewall-cmd --reload

Verify settings

iptables-save | grep 80

Will return

:OUTPUT ACCEPT [1806661:217207412]
:POSTROUTING ACCEPT [1806676:217210275]
:INPUT ACCEPT [1804142:326583229]
:OUTPUT ACCEPT [1806661:217207412]
:OUTPUT ACCEPT [1806661:217207412]
:OUTPUT ACCEPT [1806661:217207412]
-A IN_public_allow -p tcp -m tcp --dport 8090 -m conntrack --ctstate NEW -j ACCEPT
-A IN_public_allow -p tcp -m tcp --dport 80 -m conntrack --ctstate NEW -j ACCEPT

Install and Configure  a Database

MySQL

Caution!

MySQL is no longer in CentOS’s repositories and MariaDB has become the default database system offered. MariaDB is considered a drop-in replacement for MySQL; however, it is not supported by Atlassian.

 Click here to expand...

Download the Repository

The YUM repository configuration can be downloaded from the MySQL website.

http://dev.mysql.com/downloads/repo/yum/

Choose the desired distribution (Red Hat Enterprise Linux 7 / Oracle Linux 7 for this tutorial) and click Download. The download link can be retrieved without registering for an Oracle account. Locate the No thanks, just start my download link and pass the link URL as a parameter to rpm.

rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

Install MySQL Packages

MySQL server can now be installed using YUM. The MySQL client package will be included with the server package.

yum -y install mysql-community-server

Configure MySQL Server

Edit the /etc/my.cnf . Locate the [mysqld]section in the file, and add or modify the following parameters:

character-set-server=utf8
collation-server=utf8_bin
default-storage-engine=INNODB

The modify the following parameter

 max_allowed_packet=32M

Enable, Start and Check Status

/usr/bin/systemctl enable mysqld
/usr/bin/systemctl start mysqld
/usr/bin/systemctl status mysqld

Set Root Password

mysqladmin -u root password PASSWORD

Set Up Confluence Database

Log in

mysql -u root -p'PASSWORD'

Create database

CREATE DATABASE confluence CHARACTER SET utf8 COLLATE utf8_bin;

Grant Access

GRANT ALL PRIVILEGES ON confluence.* TO 'confluence'@'localhost' IDENTIFIED BY 'PASSWORD';

To set up a direct JDBC connection:

Download the driver

wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.38.tar.gz

gunzip and untar the driver files/

Copy the driver JAR file to the <confluence-install-dir>/confluence/WEB-INF/lib folder in your new or upgraded Confluence installation.

PostgreSQL

 Click here to expand...

Install PostgreSQL

# yum install postgresql-server

Initialize PostgreSQL

# service postgresql initdb
# chkconfig postgresql on

Set up password authentication

nano /var/lib/pgsql/data/pg_hba.conf

Find the lines that looks like this, near the bottom of the file, then replace "ident" with "md5"

host    all             all             127.0.0.1/32            ident
host    all             all             ::1/128                 ident

Start and enable PostgreSQL

# systemctl start postgresql
# systemctl enable postgresql

Create a role for Confluence

By default, PostgreSQL uses a concept called "roles" to aid in authentication and authorization. These are, in some ways, similar to regular Unix-style accounts, but Postgres does not distinguish between users and groups and instead prefers the more flexible term "role".

# sudo -i -u postgres

Access PostgreSQL

# psql

Create the role for Confluence

postgres=# create role confluenceuser with login password '<password>' valid until 'infinity';

Create the  database:

postgres=# create database confluence with encoding='utf-8' owner=confluenceuser connection limit=-1;

Exit out of the PostgreSQL prompt by typing and return to the previous user account:

postgres=# \q
# exit

To set up a direct JDBC connection:

Download the driver

wget http://jdbc.postgresql.org/download/postgresql-9.2-1004.jdbc4.jar

Copy the driver JAR file to the <confluence-install-dir>/confluence/WEB-INF/lib folder in your new or upgraded Confluence installation.

Start Confluence!

cd /opt/atlassian/install/atlassian-confluence-5.9.4/bin
cd ..

Navigate to http://localhost:8090/ to complete the install.

Add a Second Administrator

Note

The full admin guide is located here: Confluence Administrator's Guide

Access the Console

Go to the Confluence Admin console (usually available from the gear icon in the upper left) and log in.

Note

There is also a menu item, User Management. But we need access to the full console later.

Add a new user

Initially, we are going to admin the users via Confluence. When we are ready to go full production, we will tie to and LDAP database.

  1. Select the User tab
  2. Select Add User
  3. Set the user name (however you will do internally), and then use my email address bill@marketcomllc.com.
  4. Set whatever temp password you want. I can change it later.
  5. Select edit groups and add confluence-administrators to my list (all users MUST belong to confluence-users)

Note

Documentation located here: Add and Invite Users

Set up mail server

The ability to send email is critical to Confluence. Select the Mail Servers tab, and set up the STMP server (and please test).

Note

Documentation located here: Configuring a Server for Outgoing Mail

Done!

Crack open a cold one! (smile)

Extra Credit

Change the listen port from 8090 to 80:

https://confluence.atlassian.com/doc/using-apache-with-mod_proxy-173669.html

Note

This change is solely for user convenience but is not required and can be changed later (or I can change it). I strongly recommend this change when go to full production.

 

 

 

  • No labels