Archiva on WebSphere
The instructions here cover how to install Apache Archiva into WebSphere 6.1 on AIX V5.3 using DB2 as the backend.
Note |
---|
These scripts make heavy use of 'wsadminlib.py', a large monolithic jython library for WebSphere Administration. |
Archiva on AIX
My personal preference is to have a separate Logical Volume and File System for each major component. For example, one for Archiva, one for WebSphere, one for DB2 and so on, and have them mounted on the root. This is just my personal preference, your milage may vary, so please feel free to modify as necessary.
A sample script that creates the Logical Volume and File System is shown below. It creates the Logical Volume in a Volume Group called 'datavg'. You may wish to edit this as necessary. You will need to be the root user to execute them.
No Format |
---|
#!/bin/ksh
##################################################
# name: create-archiva.sh
# purpose: Script that will create the Archiva
# logical volume and file system.
##################################################
mklv -y'lv-arch' -t'jfs2' datavg 8
crfs -v'jfs2' -d'lv-arch' -m'/archiva' -A'yes' -p'rw'
mount /archiva
df -m
chmod g+s /archiva
|
And here is the corresponding script to remove it.
No Format |
---|
#!/bin/ksh
##################################################
# name: clean-archiva.sh
# purpose: Script that will remove the Archiva
# logical volume and file system.
##################################################
umount /archiva
rmlv -f lv-arch
rmfs -r /archiva
df -m
|
Archiva on DB2
Archiva has been used with DB2 V8.2, V9.5 and V9.7.
Archiva's reporting functions require some large tables (in terms of the size of an individual row) to be created. In DB2, these rows/table definitions must fit within a Page. The default page size for DB2 is 4K. I've found that a 32K page size is required for Archiva V1.3. If you do not have a DB2 database with a 32K page size available, you will need to create one. Here is a sample script to create one:
No Format |
---|
-- create-archiva.sql
-- SQL script to create database: ARCHIVA
-- It is created in /db2/production/archiva
-- Need to:
-- mkdir /db2/production/archiva
-- first...
CREATE DB ARCHIVA
ON /db2/production/archiva
USING CODESET UTF8 TERRITORY 'AUS'
PAGESIZE 32768
DFT_EXTENT_SZ 32
CATALOG TABLESPACE MANAGED BY SYSTEM
USING ('/db2/production/archiva/SYSCATSPACE')
EXTENTSIZE 32 PREFETCHSIZE 32
USER TABLESPACE MANAGED BY SYSTEM
USING ('/db2/production/archiva/USERSPACE1')
EXTENTSIZE 32 PREFETCHSIZE 32
TEMPORARY TABLESPACE MANAGED BY SYSTEM
USING ('/db2/production/archiva/TEMPSPACE1')
EXTENTSIZE 32 PREFETCHSIZE 128 ;
|
Execution of the script is easy enough. Log on as a DB2 administrator and execute:
No Format |
---|
db2 -tvf create-archiva.sql
|
Archiva on WebSphere 6.1
Creating and installing Archiva is a now a simple matter of executing the supplied scripts. You will probably need to edit them just to set the appropriate Cell and Node settings. Generally, the variables that need editing are at the top of the scripts.
There are four script files that have been provided.
- createArchivaServer.py
- deleteArchivaServer.py
- installArchiva.py
- wsadminlib.py
They are executed using the wsadmin.sh tool:
No Format |
---|
/was61/WebSphere/AppServer/bin/wsadmin.sh -lang jython -f <<<script file>>>
|
Attachements
- create-archiva.sh
- clean-archiva.sh
- create-archiva.sql
- createArchivaServer.py
- deleteArchivaServer.py
- installArchiva.py
- wsadminlib.py
Notes
This is simply how I do it. It does require additional machine resources, as it takes a complete JVM, but I prefer to create a server per application which provides for better application isolation and turning tuning capabilities.
I have created scripts to do all of this, but it can be equally done via the Administration Console. Archiva works fine with the default settings of "Multiple Classloaders" and either "Parent First" or "Parent Last". Do you do not need to set up a Custom Classloader to cater for the additional jars that Tomcat is missing.
The one major issue that I had was, that no matter what, I could not get Archiva to work with the supplied Apache Derby database - nor could I get it to use a different one (I was not going to update the WebSphere supplied ones directly). So, in the end I used a DB2 database. I've used both a shared DB2 database (used by other apps) and a single database just for Archiva.
1. Create a Server to host Archiva.
2. Add a custom property to the Web Container.
Application Servers > <app server> > Web Container Settings > Web Container > Custom Properties
Add a Custom Property:
Name: com.ibm.ws.webcontainer.invokefilterscompatibility
Value: true
Description: Turn on filter support.
1.2 Create a Virtual Host.
1.2.1 Create a Virtual Host Alias.
1.2.2 Set the Web Container Default Virtual Host name to the appropriate value.
1.3 Create a JAAS entry for the Database User.
1.3.1 Set a WebSphere variable "DB2UNIVERSAL_JDBC_DRIVER_PATH" to where DB2 is installed, eg "/opt/IBM/db2/V9.7/java" (DB2 9.7 on AIX).
1.3.2 Create the DB2 Universal Driver Database Provider.
1.3.3 Create the Archiva Data Source (jdbc/archiva).
1.3.4 Create the Users Data Source (jdbc/users).
1.3.5 Note: Both data sources can share the same database.
1.4 Create the Mail Session (mail/Session). Using the existing built in provider is fine.
1.5 Create a generic JVM property and set it to: "-Dappserver.home=/archiva -Dappserver.base=/archiva". Adjust your path as necessary. Both should be set to the same value.
1.6 Save and Sync the changes.
This was tested on WAS 6.1.0.15 under AIX 5.3 TL6 (and WAS 6.1.0.19 and AIX 5.3 TL8, 10 and 11).