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.

Very cool! Thanks!

Posted by Anonymous at Oct 16, 2007 21:21 | Reply To This

Additional configuration request: How to route Tomcat through Apache for server optimization.

Posted by Anonymous at Oct 16, 2007 21:32 | Reply To This

Glad you like it. Unfortunately I have not tried configuring Apache with Tomcat on this task. If you going with any hosting service like I do with eApps, the hosting service company usually has made Tomcat connector on Apache easier to setup and configure. You can take a look at this document and have a sense about how easy it is to get it done with eApps.

Good Luck,

This is great. I tried this on fedora but wasn't able to get very far. This sets it out very nicely.

Posted by Anonymous at Oct 17, 2007 13:17 | Reply To This

Great article. I do have a problem with setting up GMail as my SMTP. I downloaded your VM and did the 2 minute setup. When I edit server.xml and restart my VM, I can not login to the wiki. The web browser will not connect.

When I change back to the original server.xml and restart, I can connect.

Any ideas?

Posted by Anonymous at Oct 24, 2007 09:11 | Reply To This

Please take a look at screen shot on step 10.1, and make sure you don't have any < > mismatch.
Good Luck,

marcosjster@gmail.com

Posted by Anonymous at Jul 10, 2010 18:49 | Reply To This

Fantastic article!

Thank you.

Nicholas Muldoon
Sales Engineer
Atlassian

Posted by Anonymous at Jan 07, 2008 01:07 | Reply To This

Hi!

I downloaded the pre-installed and configured VM, but I an't get it work, because I don't know the root password.

Please provide it, because it's needed for fixing the network.

Thx,
Gelak

Posted by Anonymous at Sep 30, 2008 07:55 | Reply To This

When you do "sudo vi iftab", enter "user" as the password then you should be all set. I think the root password is simply not set during installation. And you should be able to set the root password if you want by "sudo passwd root". Please check http://www.debianadmin.com/enable-and-disable-ubuntu-root-password.html for reference. Thanks,

Very nice. Thanks!

Posted by Anonymous at Feb 13, 2009 00:45 | Reply To This

Hi there! I've donwloaded several times de .rar and it says that the files are corrupted. Any idea?
Great tool, i would like to see it working!!!!
TIA!!!!!

Posted by Anonymous at Mar 31, 2009 11:59 | Reply To This

Can you try again or use some download tools such as flashget? I tried today and I can download and extract with no problem. Thanks,

nice

Posted by Anonymous at Aug 28, 2009 10:35 | Reply To This

Personal licenses are not available anymore and the new 10$ for 10 useres are for version > 3.0
Have you tried with a more recent ubuntu server and a >3.0 confluence version ?
Thanks

Posted by Anonymous at Feb 24, 2010 10:36 | Reply To This
You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account. You can also Sign Up for a new account.
Please type the word appearing in the picture.


Negative, there are too much changes from 2.x to 3.x and I don't have time to migrate all the data. But I think 3.0 should work fine on ubuntu easily following the similar steps.

just to let you know that i did it with ubuntu 9.10 and confluence 3.1 and the latest jvm, tomcat, mysql.
Not many differences, you were right, just a few different paths.
Only thing is veeeery slow, i have to find out some fine tuning now....
Thanks for your tutorial, it helped a lot

Posted by Anonymous at Feb 26, 2010 10:15 | Reply To This

That's good news. Thanks for sharing. Maybe the newer confluence requires more memory. You might find this article helpful. http://confluence.atlassian.com/display/DOC/Fix+Out+of+Memory+errors+by+Increasing+Available+Memory#FixOutofMemoryerrorsbyIncreasingAvailableMemory-SettingtheMemorySettings

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