Dashboard > Knowledge Base > ... > Confluence > Install Confluence on Ubuntu Server Virtual Machine Baby Growth Chart | Bing's Space | Bing's Blog | Photo Album
  Knowledge Base Log In   View a printable version of the current page.  
  Install Confluence on Ubuntu Server Virtual Machine

This is the home page for the Knowledge Base space.

Added by Bing Zou, last edited by Bing Zou on Sep 27, 2007  (view change)
Labels: 

Article Rating?

Foreword

Confluence is the best wiki out there and I love it a lot. My company uses it for everything and everyday I spend at least an hour on it. I spent many hours on installing Confluence on Ubuntu Server Virtual Machine since I encountered many issues along the way. I document everything here and hope everybody will find it helpful.

Please feel free to rate this document on upper right corner. Thanks a lot!

If you are lazy...

Jump to the last part of this document to download a pre-installed and configured VM. You only need your license and configure confluence to use mysql (< 2 mins). _

Step by step Installation

Install Confluence on Ubuntu Server 7.04 Virtual Machine

Step 1 - Install VMware player

Step 2 - Download Ubuntu 7.04 server virtual machine

Step 3 - Setup network on Ubuntu 7.04 (assume there is a DHCP server in the network)

  1. Start wmware player and open the downloaded vm in step2.
  2. While prompting for UUID, choose to create a new one
  3. Use username "user" and password "user" to login
  4. Execute "ifconfig", if only lo is shown as below, please continue on to fix the network issue first. If network is working, you can skip to Step 4.
  5. Get the Correct Mac Address
    ifconfig -a
  6. write down "HWaddr" for eth1 as shown in the screen shot
  7. Change the network card settings
    cd /etc
    sudo vi iftab
    replace the mac address for eth0 with the one that has been written down
  8. Restart the server
    sudo shutdown -r now
  9. Now execute "ifconfig" you should see an ip address listed for *eth0"

Step 4 - Install Java5 JRE

sudo apt-get install sun-java5-jre

Step 5 - Install Tomcat5.5

  1. download and install tomcat 5.5
    sudo apt-get install tomcat5.5
  2. set JAVA_HOME
    sudo vi /usr/share/tomcat5.5/bin/setclasspath.sh
    add "JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun-1.5.0.11" or whatever you choose for the JRE location under "CLASSPATH="

  3. fix a known tomcat won't start up issue
    cd /usr/share/tomcat5.5/logs
    sudo mv catalina.out catalina.out.old
    sudo touch catalina.out
    sudo chown tomcat55 catalina.out
  4. set JAVA_HOME and change security setting on tomcat 5.5 auto start script
    cd /etc/init.d
    sudo vi tomcat5.5
    add JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun-1.5.0.11
    and update "TOMCAT5_SECURITY=yes" to
    TOMCAT5_SECURITY=no

Step 6 - Download and Extract Confluence

cd /home/user
mkdir downloads
cd downloads
wget http://www.atlassian.com/software/confluence/downloads/binary/confluence-2.5.6.tar.gz
tar zxvf confluence-2.5.6.tar.gz
sudo mv confluence-2.5.6 /usr/share/

Step 7 - Configure Tomcat to Use Confluence as the Default Webapp

cd /usr/share/tomcat5.5/conf
sudo vi server.xml
jump to the end of the file and add the following right above the last </Host>
        <Context path="" docBase="/usr/share/confluence-2.5.6/confluence" debug="0" reloadable="false">
          <Manager pathname="" />
        </Context>

Step 8 - Configure Confluence

  1. create directory for storing confluence data, backup, attachments, etc..
    cd /srv
    sudo mkdir confluence
    cd confluence
    sudo mkdir data
    cd ..
    sudo chown -hR tomcat55 confluence
  2. configure confluence to use the directory created above
    cd /usr/share/confluence-2.5.6/confluence/WEB-INF/classes/
    sudo vi confluence-init.properties
    uncomment the last line and change to
    confluence.home=/srv/confluence/data

  3. restart ubuntu server
    sudo shutdown -r now
    Congratulations!

    Now you should have successfully installed Confluence on a tomcat 5.5 server. Now you should be able to open a browser and point to the http://ubuntuip:8180/ and see the configuring Confluence screen. Next we will go through some post installation settings such as "how to set up Confluence to use Mysql database that supports UTF8" and "how to setup mail server using gmail".

Post Installation

Step 9 - How to Set Up Confluence to Use Mysql Database That Supports UTF8

Step 9.1 - Install Mysql server 5.0

sudo apt-get install mysql-server

Step 9.2 - Get Mysql JDBC Driver

wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.0.7.tar.gz/from/http://mirror.x10.com/mirror/mysql/
tar zxvf mysql-connector-java-5.0.7.tar.gz
cd mysql-connector-java-5.0.7
sudo cp mysql-connector-java-5.0.7-bin.jar /usr/share/confluence-2.5.6/confluence/WEB-INF/lib/
sudo shutdown -r now

Step 9.3 - Setup Mysql DataBase that supports UTF8

mysql -u root -p
hit enter directly since the default root password is empty
CREATE DATABASE confluence CHARACTER SET utf8 COLLATE utf8_general_ci;
grant all on confluence.* to 'atlassian'@'localhost' identified by 'confluence';
flush privileges;

Step 9.4 - Configure Confluence to Use Mysql Database Created Above

  1. open a broswer and hit http://ip:8180/ you should see the installation guide
  2. go to this link and request a personal license
  3. add license key then choose "Custom Installation"
  4. on "External Database", select "Mysql" from drop down menu then click on "External Databases" button
  5. click "Direct JDBC" button and use the following info
    jdbc:mysql://localhost/confluence?autoReconnect=true&useUnicode=true&characterEncoding=utf8
    username: atlassian
    password: confluence
  6. click "Next", wait a while for the database tables to be created and data initialized.
  7. Then you should see the "Load Content" page, you can choose "Empty Site", then create an admin account or choose the other paths
  8. Now you can start enjoying your personal wiki with a stable Mysql database. (++)

Step 10 - How to Setup SMTP Mail Server Using Gmail

Step 10.1 - Add Mail Server Resource to Tomcat

cd /usr/share/tomcat5.5/conf
sudo vi server.xml
inside <Context, add the following (please use your own gmail username and password)
              <Resource name="mail/Session"
                    auth="Container"
                    type="javax.mail.Session"
                    mail.smtp.host="smtp.gmail.com"
                    mail.smtp.port="465"
                    mail.smtp.auth="true"
                    mail.smtp.user="yourname@gmail.com"
                    password="yourpassword"
                    mail.smtp.starttls.enable="true"
                    mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
              />

Step 10.2 - Move mail and activation jars to Tomcat

cd /usr/share/confluence-2.5.6/confluence/WEB-INF/lib
sudo mv javamail-1.3.2.jar /usr/share/tomcat5.5/common/lib
sudo rm mail-1.3.3.jar
sudo mv activation-1.0.2.jar /usr/share/tomcat5.5/common/lib

Step 10.3 - Restart Tomcat

sudo shutdown -r now

Step 10.4 - Configure Confluence to use the mail server

  1. Login Confluence as admin
  2. Click on "Mail Servers" and choose to create a new one
  3. use JNDI and enter "java:comp/env/mail/Session"
  4. Now you should be able to send a test mail using gmail SMTP server.

Use the pre-installed and configured VM

I have gone through the steps above multiple times on brand new Ubuntu Server VM to make sure I didn't miss anything. So if you don't want to go through the steps, you can follow the steps below to have Confluence running in 2 minutes plus the download time.

Download the VM

This VM has the following software installed

  • Java 1.5.0.11 JRE
  • MySQL 5.0 with a blank "confluence" database created that supports UTF8
  • MySQL JDBC driver
  • Tomcat 5.5
  • dummy mail JNDI entry created that uses gmail smtp server
  • username and password: user/user

Please follow the steps below to have a functional confluence site in 2 minutes:

Step 1 - Fix the network

Step 2 - Connect Confluence an MySQL database

  1. open a broswer and hit http://ip:8180/ you should see the installation guide
  2. go to this link and request a personal license
  3. add license key then choose "Custom Installation"
  4. on "External Database", select "Mysql" from drop down menu then click on "External Databases" button
  5. click "Direct JDBC" button and use the following info
    jdbc:mysql://localhost/confluence?autoReconnect=true&useUnicode=true&characterEncoding=utf8
    username: atlassian
    password: confluence
  6. click "Next", wait a while for the database tables to be created and data initialized.
  7. Then you should see the "Load Content" page, you can choose "Empty Site", then create an admin account or choose the other paths
  8. Now you can start enjoying your personal wiki with a stable Mysql database. (++)

Step 3 (Optional) - Use Gmail SMTP server

  1. sudo vi /usr/share/tomcat5.5/conf/server.xml
  2. jump to the bottom of the file and replace the dummy username and password with your own
  3. restart tomcat or the VM
  4. Login Confluence as admin
  5. Click on "Mail Servers" and choose to create a new one
  6. use JNDI and enter "java:comp/env/mail/Session"
  7. Now you should be able to send a test mail using gmail SMTP server.
This site is powered by a free Atlassian Confluence Personal Server License. Evaluate Confluence for your organisation or read more about Confluence licensing here.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.6 Build:#812 Aug 06, 2007) - Bug/feature request - Contact Administrators
Wanna try out Confluence? Follow the step by step tutorial or Download the Confluence Virtual Machine with 2-minute setup