Archive

Archive for January, 2013

Confluence and Oracle 11g

January 25th, 2013 No comments

What is Confluence?
Wikipedia entry says:

Confluence is team collaboration software. Written in Java and mainly used in corporate environments, Confluence is developed and marketed by Atlassian.

 

Oracle Database Back-end
Confluence consists of two part; the front-end is the Confluence Software itself, with a back-end database. We are going to use Oracle 11g as our back-end database for Confluence. Download the latest Oracle 11g database from Oracle. We also need the latest Oracle 11g JDBC drivers (ojdbc6.jar and orai18n.jar). Make sure you use the right version of the JDBC libraries for your version of Oracle. I am using Oracle 11.2.0, so I need the 11.2.0.1.0 of ojdbc6.jar and orai18n.jar.

Read the Confluence instructions for the Oracle database setup.

Oracle 11g Install
This is fairly simple if you keep a few things in mind. The install is done via a GUI, so have your display (permission) setup properly if you are performing the install remotely. I use X forwarding in a SSH session:

ssh -X -l oracle <confluence_db_server>

The other thing to remember is setting the max-shm-memory variable so that Oracle has enough memory space to run and create the database.

projadd -U oracle -K "project.max-shm-memory=(priv,10GB,deny)" user.oracle
projmod -K "project.max-shm-memory=(priv,16GB,deny)" user.oracle

I’ve found that I need 16GB to install, but other have found 10GB sufficient.

Once Oracle 11 is installed and the database for confluence has been created, we need to create a user and schema for the Oracle database (Confluence instance) and grant this user the connect and resource privileges:

> sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Fri Jan 25 11:29:17 2013
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
SQL> connect / as sysdba
Connected.
SQL> create user confluence identified by ***********;
User created.
SQL> grant connect to confluence;
Grant succeeded.
SQL> grant create table to confluence;
Grant succeeded.
SQL> grant create trigger to confluence;
Grant succeeded.
SQL> create view confluence.all_object as select * from sys.all_objects where owner = upper('confluence');
View created.

To verify if your database and user has been created, use these commands:

SQL> select * from all_users;
USERNAME
--------------------------
   USER_ID CREATED
---------- ---------------
CONFLUENCE
        91 25-JAN-13
BI
        90 24-JAN-13
PM
        89 24-JAN-13
<cut>

Login as confluence user and create a table:

sqlplus confluence/<password>@confluence_db_SID
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jan 28 12:39:21 2013
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create table employee (empid char(9) not null, primary key (empid));
Table created.
SQL> select * from session_privs;
PRIVILEGE
----------------------------------------------
CREATE SESSION
UNLIMITED TABLESPACE
CREATE TABLE
CREATE CLUSTER
CREATE SEQUENCE
CREATE PROCEDURE
CREATE TRIGGER
CREATE TYPE
CREATE OPERATOR
CREATE INDEXTYPE
10 rows selected.
SQL>

As Oracle user run the satus command to get all the needed Oracle info for the Confluence software setup:

> lsnrctl status
LSNRCTL for Solaris: Version 11.2.0.1.0 - Production on 28-JAN-2013 14:33:25
Copyright (c) 1991, 2009, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Solaris: Version 11.2.0.1.0 - Production
Start Date                28-JAN-2013 13:22:41
Uptime                    0 days 1 hr. 10 min. 45 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /oracle/app/oracle/diag/tnslsnr/ence/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=CONFLUENCE_DB_HOST)(PORT=1521)))
Services Summary...
Service "CONFLUENCE_ORACLE_SID" has 1 instance(s).
  Instance "CONFLUENCE_ORACLE_SID", status READY, has 1 handler(s) for this service...
Service "CONFLUENCE_ORACLE_SIDXDB" has 1 instance(s).
  Instance "CONFLUENCE_ORACLE_SID", status READY, has 1 handler(s) for this service...
The command completed successfully

 

Confluence Install
Download the latest Confluence Software from Atlassian. I downloading the tar.gz file for Linux, and transferred it to my Solaris 10 zone.

Create confluence directory and unzip:

mkdir -p /usr/local/confluence
cd /usr/local/confluence
/usr/sfw/bin/gtar zxvf /var/tmp/atlassian-confluence-4.3.6.tar.gz

If you have not a confluence user on your system, create one and change the ownership of the files to this user:

useradd -d /usr/local/confluence confluence
chown -R confluence /usr/local/confluence

 

Configure Confluence

First of all we need to create a directory for the local data:

vi /usr/local/confluence/confluence-4.3.6/confluence/WEB-INF/classes/confluence-init.properties

Uncomment the last line and add your location:

confluence.home=/usr/local/confluence/var/

Create the directory and make it owned by the confluence user:

mkdir -p /usr/local/confluence/var
chown confluence /usr/local/confluence/var

Configure datasource resource, by editing the server.xml file entering the Oracle database information:

vi /usr/local/confluence/confluence-4.3.6/conf/server.xml

Adding this following just above the <Manager pathname=””>, under the Host -> Context section:

         <Resource
         name="jdbc/confluence"
         auth="Container"
         type="javax.sql.DataSource"
         driverClassName="oracle.jdbc.OracleDriver"
         url="jdbc:oracle:thin:@hostname:port:sid"
         username="<username>"
         password="<password>"
         connectionProperties="SetBigStringTryClob=true"
         maxActive="25"
         maxIdle="5"
         maxWait="10000"
         />

Replace the hostname with the Confluence Oracle database server, and the sid with the Confluence database SID. The port is the Oracle standard port of 1521, unless you are running the Confluence Oracle database on a different port.

Lastly, we must insert a reference for this datasource, edit the web.xml file:

vi /usr/local/confluence/confluence-4.3.6/confluence/WEB-INF/web.xml

Adding the following lines before the </web-app> tag:

<resource-ref>
    <description>Connection Pool</description>
    <res-ref-name>jdbc/confluence</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
</resource-ref>

 

Confluence Startup and Shutdown
There are startup and shutdown scripts in /bin. We can proceed to startup Confluence and continue through the install using the Wizard:

/usr/local/confluence/confluence-4.3.6/bin/startup.sh

If all is well you will see the Java process that is running Confluence in your processes list:

ps -ef|grep java
 cfeuser  5427  5423   0 10:30:36 pts/4       0:00 grep java
 cfeuser  5158  4662   0 10:25:02 ?           5:32 /usr/bin/java  Djava.util.logging.config.file=/usr/local/confluence/conf/loggin

Confluence Configuration Wizard
You now need to complete your setup using the Web wizard. Fire up your favourite browser and point it at your Confluence server on the right port. Here my (server.xml) configuration says port 8090:

more conf/server.xml
<Server port="8000" shutdown="SHUTDOWN" debug="0"<
    <Service name="Tomcat-Standalone"<
        <Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="8090" minProcessors="5" maxProcessors="75"

[cut]
Categories: Uncategorized Tags: