Wednesday, August 20, 2008

Installing archiva/continuum with tomcat+mysql on ubuntu

continuum documentation is kinda ... not finished yet. I'm in the process of installing the archiva/continuum double on an recent ubuntu server (hardy).
Database is a mysql 5.0 which I installed before.

Some trouble occurred when trying to connect the archiva webapp (which i installed first) to the database. For this, check /etc/my.cnf for the bind address as well as
the connect properties of the archiva database user (self-reminder). It can make a
difference if you connect at 127.0.0.1, localhost or the "real" IP.
Also, you may have to allow the port through the firewall (the "ufw allow" thing).

For archiva, I created the file /usr/local/tomcat/conf/Catalina/localhost/archiva.xml (with /usr/local/tomcat being my CATALINA_HOME):

<Context path="/archiva"quot;>
<Resource name="jdbc/users"
auth="Container"
type="javax.sql.DataSource"
username="archiva"
password="freetibet"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/archiva" />

<Resource name="jdbc/archiva"
auth="Container"
type="javax.sql.DataSource"
username="archiva"
password="freetibet"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/archiva" />

<Resource name="mail/Session"
auth="Container"
type="javax.mail.Session"
mail.smtp.host="localhost"/>
</Context>


For continuum, just copy the file, rename it to continuum.xml, change the username
accordingly and switch jdbc/archiva to jdbc/continuum.

If you are using Tomcat 6.0.18 beware. Due to these bugs (MRM-905 and CONTINUUM-1844) you will have to apply
two patches or just fire up some sed commands to replace "empty(" with "empty ("
and "not(" with "not (" in the jsp and tag directories.

I didn't put the webapps into the CATALINA_HOME like the documentation tell you to,
but into the standard CATALINA_HOME/webapps Folder.

Be sure to put the necessary libs into CATALINA_HOME/lib: mail.jar, activation.jar
and the mysql-connector.

Boy, this post is a mess.

1 comment:

Unknown said...

Cool!
It is short and clear!

Thank you.

P.S.
The environment:

Oracle Linux U6, tomcat 7.0.50, jdk1.7.0_51, Archiva 1.4-M4, mysql 5.6.16.