Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

See Confluence Setup Archive for older versions of Confluence.

Table of Contents

Introduction

Confluence is a knowledge management system. If you are not sure why you would want to use Confluence, you might want to read the Introduction to Knowledge Management.

...

Ideally your system should have about 1 GB of memory set aside for Confluence. Confluence itself with a small user base under 10 takes about 750MB of memory.

Install Required Dependent OS Packages

Confluence and in turn Java uses fonts to export to pdf and show powerpoint slides. According to Oracle for Solaris and Unix there is a requirement for valid X11 fonts.

Code Block
sudo apt-get install fontconfig

PostgreSQL

Confluence comes with its own embedded database called hsqldb. However, for real production use you should use a full fledged database like PostgreSQL. It is recommended to install a supported version.

Install PostgreSQL on Ubuntu

Install PostgreSQL on Ubuntu.

Install Confluence

Core Package

Go to the Confluence download page and get the most recent Linux tar.gz install package and decompress it,

...

Code Block
languagebash
su - bhitch # log in as a staff user that can run sudo
cd /opt
# make a symbolic link which scripts and commands can run against
sudo ln -s ./atlassian-confluence-4.0.5 ./confluence

Manually Setup JRE

I use a manual Java setup with an instance of Java specifically for the application.

...

Code Block
languagebash
cd /home/serveradmin
sudo mv ./java/ /opt/confluence/

Configure Confluence to Use JRE

The downloaded Confluence package is powered by Tomcat. You can specify Tomcat use a specific java directory.

...

Code Block
languagebash
./version.sh 
If you encounter issues starting up Confluence, please see the Installation guide at http://confluence.atlassian.com/display/DOC/Confluence+Installation+Guide

Server startup logs are located in /opt/confluence/logs/catalina.out
Using CATALINA_BASE:   /opt/confluence
Using CATALINA_HOME:   /opt/confluence
Using CATALINA_TMPDIR: /opt/confluence/temp
Using JRE_HOME:        /opt/confluence/java
Using CLASSPATH:       /opt/confluence/bin/bootstrap.jar:/opt/confluence/bin/tomcat-juli.jar
Using CATALINA_PID:    /opt/confluence/work/catalina.pid
Server version: Apache Tomcat/8.0.36
Server built:   Jun 9 2016 13:55:50 UTC
Server number:  8.0.36.0
OS Name:        Linux
OS Version:     4.15.0-54-generic
Architecture:   amd64
JVM Version:    12.0.2+10
JVM Vendor:     Oracle Corporation


Configure Confluence to Only Start and Stop with ServerAdmin

To prevent read errors and for security purposes we want Confluence to only run as with the operating account serveradmin.

...

SectionTomcatConfluence
Only Allow serveradmin to Run Tomcat/opt/apache/tomcat.1/bin/startup.sh/opt/confluence/bin/startup.sh

/opt/apache/tomcat.1/bin/shutdown.sh/opt/confluence/bin/shutdown.sh

Modify user.sh

As of Confluence 4.x, new start up scripts added,

...

Code Block
languagebash
# START INSTALLER MAGIC ! DO NOT EDIT !
CONF_USER="serveradmin" # Only this user may run start-confluence.sh or stop-confluence.sh
# END INSTALLER MAGIC ! DO NOT EDIT !

export CONF_USER

Configure Data Directory

Also we need to create the home directory,

...

Panel

# confluence.home=c:/confluence/data
confluence.home=/opt/confluence-data/

Optional Restrict Access to Confluence Folders

In a multipurpose environment, you may want to restrict access to the Confluence folders. The BonsaiFramework uses the following approach,

...

Now only users belonging to staff or serveradmin can view the Confluence folders.

Configure PostgreSQL

Setup Database

These are the command line version of the instructions from Confluences wiki on setting up an external database.

...

Note

The name of the database is different than in the confluence documentation. Rather than the database name confluence, we use confluencedb to clearly designate a database.

Check Updated JDBC Driver

Generally, Confluence is pretty good at packaging the most up to date JDBC driver or their supported databases and you can skip this step.

...

Code Block
languagebash
su - serveradmin
cd /opt/confluence/confluence/WEB-INF/lib/
 
# delete the existing jar
ls postgres*
postgresql-9.2-1002.jdbc4.jar
rm postgresql-9.2-1002.jdbc4.jar # Delete the old jar file
 
# In this case the version of Java and Postgres calls for using a newer jdbc41 driver,
wget https://jdbc.postgresql.org/download/postgresql-9.3-1103.jdbc41.jar

Starting the Confluence Service

Starting Confluence for the first time involves going starting the process and using a wizard to build the initial database.

...

The intial user will be called "Server Admin" with user name serveradmin. Use a special email for this account and keep in mind that Confluence enforces that email addresses must be unique across all users.

Stopping the Service

There appears to be a problem with shutting down the Confluence server. According to Atlassian, this only happens on certain configuration and they are not able to determine yet why. I have personally experienced with every type of Virtualized Ubuntu system I have setup over the past few years. It seems to occur once there is 2-3 users worth of activity and data in the wiki.

...

Code Block
languagebash
kill 2364 # Note change 2364, to the process ID that you see on your screen.

Initial Administrator Tasks

Warning

TBC - This section still needs to be written to take the user through setting up the base url, creating their first space with subsections to disabling automatic backup, how to do real backups and any other important activities.

Optimize Confluence

Warning

These instructions should be written with more detail. Particularly, "Setup email".

...

  1. Setup email
  2. Update Confluence plugins

Disable Search Engine Indexing

In the case of a private site, you may not want Google or any other search engine to crawl your wiki. Even in the case of a password protected site this will still happen and take up unnecessary bandwidth, processing and bump up the amount of memory consumed by Confluence.

...

Code Block
User-agent: *
Disallow: /wiki/

Enable User Activity Logging

This is optional, but in an environment with sensitive data you may want to see what users are doing what,

https://confluence.atlassian.com/display/CONFKB/How+to+Enable+User+Access+Logging

Connect Apache to Confluence

As this install of Confluence is powered by Tomcat we can front Confluence with the Apache Web Server.

First start with setting up your Web Server.

Connect Apache to Confluence using mod_Proxy

....

Connect Apache to Confluence using mod_JK

Start by reviewing the generic instructions to configure Tomcat (the engine that Confluence uses) with Apache using mod_jk.

Warning
As of Confluence 6.0 or later, it is no longer endorsed to use only mod_jk to proxy. his is because Synchrony, which is required for collaborative editing, cannot accept AJP connections. The preferred configuration is Using Apache with mod_proxy.

Enable Tomcat AJP Connector

First we must enable the the Connector. In this example we will use the standard port 8009 in the Confluence Tomcat. Edit /opt/confluence/conf/server.xml.

...

Info

The UTF-8 is important as Confluence is developed to post using UTF-8.

Without this setting errors occur when working with attachments containing special characters. Further details are covered in the Bonsai Tomcat Connector article.

Select and Enable Context Path

Often you want to use the Apache Web Server to front more than one web application. In order to do this you want each web application to work within it's own context. This is pretty standard in most java applications. As such, we will pick a context path, in this case "wiki". As such the original url, http://localhost:8090/ changes to http://localhost:8090/wiki

...

This change does not take effect until the Confluence service stopped and started again. We will do that in the the next section.

Configure Apache Tomcat Connector

Warning

Still need to fill in clearer instructions on this topic.

Once port 8009 is enabled, mod_jk can be enabled by following the Apache Tomcat Connector instructions.

Change Base URL in Confluence

Warning

Put instructions here about changing the base url if fronted by Apache.


Verify Internationalization Features

Even if you do not plan to have the wiki work for multiple languages, you should verify the internationalization is working properly just to handle special characters.

Visit the http://<host address>:<port>/admin/encodingtest.action url on your system and follow the instructions.

Future Upgrade Notes

As part of planning for future upgrades here is a checklist to keep in mind. As an example, we will be upgrading from Confluence 4.0.5 to 4.3.2.

Review the Upgrade and Release Notes

Take note of any significant changes, especially between larger release numbers.

Backup Your Data

It goes without saying, backup your data. With Cloud and Virtual computing take a snap shot. With manual backups you can use Confluence's built in backup utility through the web interface (to do: provide link to instructions) or manually make the following backups,

  • TAR and Compress the Confluence data home folder for backup purposes
  • Backup the database using your database management tools (will link to Roderick's articles on backing up of PostgreSQL here)

Database Password

Make sure you know the admin password for your database.

Java

Make sure to copy over the java folder or take this opportunity to install an updated version of Java.

Copy Existing Java

To copy the existing version of Java,

Code Block
languagebash
su - serveradmin
cp -R /opt/confluence/java /opt/atlassian-confluence-4.3.2/java
exit
sudo ln -s ./atlassian-confluence-4.0.5 ./confluence

Upgrade Java

Follow the steps in this article about how to Manually Setup the JRE.

...

Check that the version of Java and the Postgres JDBC version match up and and update accordingly (see setup instructions in this same article for details).

Key Files

Over time this may change, for example the user.sh file was added when moving between Confluece 3.x and 4.x. So, whoever does the upgrade please update the notes below,

...

  • /opt/confluence/confluence/WEB-INF/lib/postgresql-8.4-701.jdbc4.jar - add
  • /opt/confluence/confluence/WEB-INF/lib/postgresql-8.4-701.jdbc3.jar - remove

Special Modifications

You may choose to modify special files. For  example, I modify the footer,

  • /opt/confluence/confluence/decorators/includes/footer-content.vm

If you used a symbolic link as described in this article, make sure to update your symbolic link,

Code Block
languagebash
cd /opt/
sudo rm confluence
sudo ln -s ./atlassian-confluence-4.3.2 ./confluence

Plug-Ins

Also, keep a page listing any plug-ins you install. Upgrades generally do not require you to reinstall the plugins but they might be deprecated. After the upgrade is done, login as Administrator on Confluence and ensure plug-ins are up to date.

...

Info

Check out the Confluence Plugins page for more details.

Check Administration Console

The Administration Console may also have messages for you to run specific tasks with instructions. For example when upgrading from 3.5.4 to 4.1, "Update content with incompatible upgraded macros".

Confluence Customizations

 Ensure any customization done are carried over.

Enable Logging

... done up above list files...

Change favicon.ico

Currently, Confluence does not provide an easy way to change the favicon.ico that will persist after an upgrade. If you want this feature, vote for this request on Jira. Otherwise, a good solution may be implemented using Apache's mod_rewrite.

...

Finally drop a favicon.ico into your virtual host's root directory. In this example, /home/www.krypton.com/www/

System Profile

Using htop, initial setup without any spaces created is 396MB. The process itself uses  VIRT=913M and RES=338M.

Changing the Server ID

If you are migrating a Confluence instance to a new server and the Server ID was not changed after a full restore.

...