Advertisement

I spent most of todays time with the installation of the Apache Archiva repository server for corporate use. I found out that there isn’t much documentation available on this topic, especially if you don’t want to use Apache Derby as a database and use the latest tomcat 5.5 installation that comes with the Ubuntu 7.10 server edition.

Our approach is straight forward, but I’d like to share it with you because I’m sure some more people want to have the same type of installation.

Get the .war File
Download the archiva.war file from the official apache Archiva site. Be sure to get the .war version. The standalone version works out of the box but comes with it’s own jetty server instance.

Create the archiva deployment directory
Create a directory with the name archiva.

mkdir /usr/share/tomcat5.5/archiva
cd /usr/share/tomcat5.5/archiva
wget http://apache.atviraskodas.com/maven/binaries/apache-archiva-1.0.war

Check for mail.jar and mysql jdbc driver
Check if the file mail.jar and the mysql jdbc driver (mysql-connector-java-X.X.X-bin.jar) are present in /usr/share/tomcat5.5/common/lib.

Create the mysql database and user
In Mysql create a database with the name archiva and create a user with the name archiva. Don’t forget to grant all privileges to the archiva user and set the Hosts column to “%” for this user in the user table of the mysql database.

Create the Archiva context file
Create the file /usr/share/tomcat5.5/conf/Catalina/localhost/archiva.xml



    
    
    

Set the appserver.base environment variable
Add the appserver.base java environmet variable to the CATALINA_OPTS line in /etc/default/tomcat5.5 to

CATALINA_OPTS="-Dappserver.base=/var/lib/tomcat5.5 -Djava.awt.headless=true -Xmx128M -server"

Fix the tomcat policies

Create a file named 30archiva.policy in the directory /etc/tomcat5.5/policy.d and insert this code:

archiva.policygrant codeBase "file:${catalina.home}/webapps/archiva/-" {
    permission java.security.AllPermission;
//  permission java.util.PropertyPermission "*","read";};

Restart the server

/etc/init.d/tomcat5.5 restart

And finally…
Now you can gaze at your new Archiva installation.
Go and send your browser to http://yourServerName/archiva

… and now party. :)

BTW: The steps to install Apache Continuum are quite the same. Just change “archiva” to “continuum” in the steps.