Note |
---|
This article has lots of room for improvement in tone and the instructions can be more clear. |
Table of Contents |
---|
Install Required Libraries
Note |
---|
As of Confluence 3.5, X11 dependencies are now no longer needed. |
...
Tip |
---|
Because the list changes between each release, I recommend documenting what you installed. Then when upgrading, you can take two approaches,
Due to complex dependencies, we find that the first approach works better. |
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,
...
Code Block | ||
---|---|---|
| ||
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.
...
Code Block | ||
---|---|---|
| ||
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.
Warning |
---|
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,
...
Panel |
---|
# confluence.home=c:/confluence/data |
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. |
Setup JDBC4 Driver
Note |
---|
As of Confluence 3.5.1 the PostgreSQL JDBC4 driver is now included. This section is still useful as a reference for future version mismatches. |
...
Code Block | ||
---|---|---|
| ||
su - serveradmin wget http://jdbc.postgresql.org/download/postgresql-9.0-801.jdbc4.jar rm /opt/confluence/confluence/WEB-INF/lib/postgresql-8.4-701.jdbc3.jar |
Starting the Confluence Service
We will now start Confluence for the first time to initialize everything.
...
- Choose Product Installation
- 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
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.
...
Code Block | ||
---|---|---|
| ||
kill 2364 # Note change 2364, to the process ID that you see on your screen. |
Administrator Tasks
Warning |
---|
This section still needs to be written to take the user through setting up the base url, creating their first space, disabling automatic backup, how to do real backups and any other important activities. |
Optimize Confluence
There are some basic tasks we should do before getting other people on board.
...
- 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.
Enable Tomcat AJP Connector
First we must enable the the Connector. In this example we will use the standard port 9009 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:8080/ changes to http://localhost:8080/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.
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.
Database Password
Make sure you know the admin password for your database.
Key Files
- /opt/confluence/bin/setevn.sh
- /opt/confluence/conf/server.xml
- /opt\confluence/confluence/WEB-INF/classes/confluence-init.properties
- /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
- /opt/confluence/bin/shutdown.sh
- /opt/confluence/bin/startup.sh
Special Modifications
You may choose to modify special files. For example, I modify the footer,
- /opt/confluence/confluence/decorators/includes/footer-content.vm
Package Dependencies
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,
...
Also, keep a page listing any plugins 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.
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.
...