|
|
rate-1048588-11626
| 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 3 - Setup network on Ubuntu 7.04 (assume there is a DHCP server in the network)
- Start wmware player and open the downloaded vm in step2.
- While prompting for UUID, choose to create a new one

- Use username "user" and password "user" to login
- 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.

- Get the Correct Mac Address
- write down "HWaddr" for eth1 as shown in the screen shot

- Change the network card settings
cd /etc
sudo vi iftab
replace the mac address for eth0 with the one that has been written down
- Restart the server
- 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
- download and install tomcat 5.5
sudo apt-get install tomcat5.5
- 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="

- 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
- 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: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
- 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
- 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

- restart ubuntu server
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: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
- open a broswer and hit http://ip:8180/
you should see the installation guide
- go to this link
and request a personal license
- add license key then choose "Custom Installation"
- on "External Database", select "Mysql" from drop down menu then click on "External Databases" button
- click "Direct JDBC" button and use the following info
jdbc:mysql:username: atlassian
password: confluence
- click "Next", wait a while for the database tables to be created and data initialized.
- Then you should see the "Load Content" page, you can choose "Empty Site", then create an admin account or choose the other paths
- 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
Step 10.4 - Configure Confluence to use the mail server
- Login Confluence as admin
- Click on "Mail Servers" and choose to create a new one
- use JNDI and enter "java:comp/env/mail/Session"
- 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. 
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 2 - Connect Confluence an MySQL database
- open a broswer and hit http://ip:8180/
you should see the installation guide
- go to this link
and request a personal license
- add license key then choose "Custom Installation"
- on "External Database", select "Mysql" from drop down menu then click on "External Databases" button
- click "Direct JDBC" button and use the following info
jdbc:mysql:username: atlassian
password: confluence
- click "Next", wait a while for the database tables to be created and data initialized.
- Then you should see the "Load Content" page, you can choose "Empty Site", then create an admin account or choose the other paths
- Now you can start enjoying your personal wiki with a stable Mysql database. (++)
Step 3 (Optional) - Use Gmail SMTP server
- sudo vi /usr/share/tomcat5.5/conf/server.xml
- jump to the bottom of the file and replace the dummy username and password with your own
- restart tomcat or the VM
- Login Confluence as admin
- Click on "Mail Servers" and choose to create a new one
- use JNDI and enter "java:comp/env/mail/Session"
- Now you should be able to send a test mail using gmail SMTP server.
