About the art of building metaphoric solutions to real world problems.
4 Jan
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.

4 Responses for "Installing Apache Archiva on Ubuntu 7.10 with mysql database backend"
Apache Archiva 1.0 uses JPOX ( http://www.jpox.org/ ) to handle all of its Database persistence.
There have been some reported issues with Apache Archiva on mysql, downgrading from mysql jdbc driver 5.1 to 5.0.x seems to solve them, we use 5.0.4 for our Apache Archiva development.
In maven 2 terms.
mysql
mysql-connector-java
5.0.4
You can find (if you dig a little) how to setup Apache Archiva 1.0 on Jetty w/MySQL too.
http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/jetty-env-mysql.xml?view=markup
I develop Apache Archiva that way btw. Using the “-Pmysql” profile while in the archiva-webapp module.
- Joakim
Thank you for your comment, Joakim.
I have changed the link to the JDBC driver in the blog entry to:
http://dev.mysql.com/downloads/connector/j/5.0.html
[...] see the two main topics you all come here Reading my article about my favorite eclipse plugins, my apache archiva installation instructions and how to write an eclipse keyword [...]
Im trying to install Apache Archiva into Apache Tomcat 5.5.30, into mysql following the steps listed above but not work. My SO is Debian, but the steps are the same.
I try and try, but in each try tomcat say me that the webapp cannot start.
Im using:
Tomcat 5.5.30
debian 5
mysql-connector-java-5.0.8
apache-archiva-1.3.1
Can you Helpme?
Leave a reply