This article has lots of room for improvement in tone and the instructions can be more clear.
Install Required Libraries
In order to render thumbnails and related functionality you need certain x-windows libraries. Refer to the list from the Confluence install instructions and make sure to use the list matching your version of Confluence.
Because the list changes between each release, I recommend documenting what you installed. Then when upgrading, remove all the required libraries from the previous Confluence release and then installing the required libraries for the new Confluence release.
PostgreSQL
Confluence comes with its own embedded database called hsqldb. However, for real production use you should use a full fledged database like PostgreSQL.
Install PostgreSQL on Ubuntu
Install PostgreSQL6.0 PostgreSQL on Ubuntu.
Install Confluence
Core Package
Download the tar.gz install package and decompress it,
su - serveradmin # if you are not already gunzip confluence-3.2-std.tar.gz tar -xvpf confluence-3.2-std.tar su - bhitch # log in as a staff user that can run sudo # Use specific version numbers. This will make upgrade easier in the future. sudo mv home/serveradmin/confluence-3.2-std /opt/
Next, we make the symbolic link directory. Scripts and anything else you do will use the symbolic link directory. When the new version of Confluence comes along you have various options for upgrading.
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 ./confluence-3.2-std ./confluence
Manually Setup JDK
I use a manual Java setup with an instance of Java specifically for the application.
Make sure you are install a JDK. This is a requirement of Confluence.
Log in as your staff account which has sudo access to perform the actual move to /opt/
cd /home/serveradmin sudo mv ./jdk1.6.0_16/ /opt/confluence/java # moves and renames the directory in one step
Configure Confluence to Use JDK
The downloaded Confluence package is powered by Tomcat. You can specify Tomcat use a specific java directory by modifying the Confluence setenv.sh file as described at Running Tomcat with a specific JRE version.
This can be improved by moving "how to specify java for Tomcat" out of the Tomcat 6 setup instructions into a separate page and then using an "include" here.
Configure Data Directory
Also we need to create the home directory,
su - serveradmin cd ~ mkdir confluence-data # Don't use specific version numbers here because the data will actually be upgraded su - bhitch # to get sudo access sudo mv /home/serveradmin/confluence-data /opt/
As serveradmin, set the home (data) directory by modifying the files, /opt/confluence/WEB-INF/classes/confluence-init.properties, go to the bottom of the file,
# confluence.home=c:/confluence/data
confluence.home=/opt/confluence-data/
Configure PostgreSQL
These are abridged instructions from Confluences wiki on setting up an external database.
Rather than use the gui we can do everything from the command line. I derived the commands from the visual guide by Confluence.
First log into the PostgreSQL prompt as explain in PostgreSQL on Ubuntu.
Create the confluence database admin account,CREATE ROLE confluencedbuser LOGIN ENCRYPTED PASSWORD 'putYourPasswordHere'
NOINHERIT
VALID UNTIL 'infinity';
COMMENT ON ROLE confluencedbuser IS 'Account used by the Confluence application.';
Create the database.
CREATE DATABASE confluencedb
WITH ENCODING='UTF8'
OWNER=confluencedbuser
CONNECTION LIMIT=-1;
I changed the name used in the confluence documentation from confluence to confluencedb. As a coder it will be easier for me later one.
Confluence 3.2 does include a JDBC driver for PostgreSQL. However, because we are using the newest Java download the JDBC4 driver from the PostgreSQL website.
First delete the jdbc3 driver,rm /opt/confluence/confluence/WEB-INF/lib/postgresql-8.4-701.jdbc3.jar
Then, place the JDBC Driver postgresql-8.4-701.jdbc4.jar into the <confluence-install-path>/confluence/WEB-INF/lib folder.
Starting the Confluence Service
We will now start Confluence for the first time to initialize everything.
If using virtual machine technology, now would be a good time to take a snapshot of the system.
cd /opt/confluence/bin/ ./startup.sh
In the Confluence notes they sometimes use catalina.sh instead of startup.sh. Investigate the difference.
Next, hit the website with a browser, http://localhost:8080/ or change localhost to the ip address if you are not launching the browser off of the server.
If you have been following this tutorial on how to setup Ubuntu, your firewall may be enabled. Make sure to enable access to port 8080.
The very first time Confluence starts it asks you to make selections,
Everything below here needs to be flushed out better.
- Choose custom
- Makes sure PostgreSQL is selected (it should be by default) click External Database.
- Direct JDBC
- Fill out the form,
- Database URL: Change the default line, jdbc:postgresql://localhost:5432/confluence to jdbc:postgresql://localhost:5432/confluencedb
- User: confluencedbuser
- Pass: the pasword you used earlier to create the user
- The intial user will be called "Server Admin" with user name serveradmin
Optimize Confluence
There are some basic tasks we should do before getting other people on board.
Once logged in go to, Browser, Confluence Admin. There are tasks there that Confluence recommends, the most important to us being,
These instructions should be written with more detail. Particularly, "Setup email".
- Disable automatic backup
- Setup email
- Update Confluence plugins
Connect Apache to Confluence using Mod_JK
As this install of Confluence is powered by Tomcat we can front Confluence with the Apache Web Server.
First we must enable the standard port 9009.
Still need to fill in instructions on this topic.
Once port 9009 is enabled, mod_jk can be enabled by following the Apache Tomcat Connector instructions.
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 this on pretty much every type of Ubuntu system setup by myself and by others. So here are the steps to ensure Confluence actually shuts down,
ps -ef | grep java | grep confluence
Then try the ./shutdown.sh
ps -ef | grep java | grep confluence
Which usually shows it is still running so then I do,
kill #### where #### is the process id
Future Upgrade Notes
s part of planning for future upgrades listed here are the key files to keep in mind,
- \bin\setevn.sh
- \bin\shutdown.sh
- \bin\startup.sh
- \bin\conf\server.xml
- confluence\WEB-INF\classes\confluence-init.properties
- opt\confluence-3.2.1_01-std\postgresql-8.4-701.jdbc4.jar - add
- opt\confluence-3.2.1_01-std\postgresql-8.4-701.jdbc3.jar - remove
The package dependencies change between confluence versions. You should check if there are differences. For example look at the difference between 3.1 and 3.2 ,
confluence-3.1
- libice-dev - nolonger used
- libsm-dev - nolonger used
- libx11-dev - used
- libxext-dev - nolonger used
- libxp-dev - nolonger used
- libxt-dev - nolonger used
- libxtst-dev - used
confluence-3.2
- libx11-6 - new
- libx11-dev - carry over
- libxt6 - new
- libxt6-dbg - new
- libxext6 -new
- libxtst-dev - carry over
- libxtst6 - new
- xlibs-dbg - new
- xlibs-dev - new
Also, keep a page listing any plugins you install. Upgrades generally do not require you to reinstall the plugins but they might be deprecated so make that after the upgrade is done, login as Administrator on Confluence and ensure plug-ins are up to date.