Extremely Serious

Configuring Archiva with MariaDB in Synology Diskstation

  1. Install Tomcat 7 package in Diskstation
  2. Download archiva war file from the following address:
    https://archiva.apache.org/index.cgi
  3. Place the downloaded war fileĀ (e.g. apache-archiva-2.2.3.war) into the following directory:
    /volume1/@appstore/Tomcat7/src/webapps/
  4. In MariaDB, add the following user with appropriate password.
    archivauser

    and the following database

    archiva
  5. Download the following jar files:
    mail-1.4.jar 
    mariadb-java-client-1.5.x.jar
  6. Place the download jar files in the following directory:
    /volume1/@appstore/Tomcat7/src/lib
  7. Create archiva.xml file in the following location:
    /volume1/@appstore/Tomcat7/src/conf/Catalina/localhost

    Add the following entries:

    <?xml version="1.0" encoding="UTF-8"?>
    <Context path="/archiva" docBase="/volume1/@appstore/Tomcat7/src/webapps/<ARCHIVA_WAR_FILENAME>">
    <Resource name="jdbc/users" auth="Container" type="javax.sql.DataSource"
    	username="archivauser"
    	password="<PASSWORD_HERE>"
    	driverClassName="org.mariadb.jdbc.Driver"
    	url="jdbc:mariadb://<MARIADB_HOST_IP>:<MARIADB_HOST_PORT
    	/archiva?autoReconnect=true" />
    <Resource name="mail/Session" auth="Container" 	type="javax.mail.Session" mail.smtp.host="localhost"/>
    </Context>

    Note: The <ARCHIVA_WAR_FILENAME>, <PASSWORD_HERE> <MARIADB_HOST_IP> and <MARIADB_HOST_PORT tokens must be replaced by the downloaded war file from step 2, password used from step 4, IP address of MariaDB and port used by MariaDB repectively.

  8. Access archiva using the following address:
    http://<DISKSTATION_HOST_IP>:7070/archiva

    Note: Update the token <DISKSTATION_HOST_IP> with the IP of your Synology Diskstation.

3 Comments

  1. Alain

    Hi Ron,

    I use your tutorail to set Mariadb with my archiva.

    I can’t use Archiva (2.2.4) with Mariadb (mysql Ver 15.1 Distrib 10.4.9-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2).
    I got always error in DB with the constraint
    java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘INITIALLY DEFERRED’ at line 1
    Query is: ALTER TABLE SECURITY_PERMISSIONS ADD CONSTRAINT SECURITY_PERMISSIONS_FK2 FOREIGN KEY (RESOURCE_IDENTIFIER_OID) REFERENCES SECURITY_RESOURCES (IDENTIFIER) INITIALLY DEFERRED

    Is something is missing in tutorial ?

    Best regards

    Alain

    • ron

      Hi Alain, try to execute the statement without the initially deferred like the following:

      ALTER TABLE SECURITY_PERMISSIONS ADD CONSTRAINT SECURITY_PERMISSIONS_FK2 FOREIGN KEY (RESOURCE_IDENTIFIER_OID) REFERENCES SECURITY_RESOURCES (IDENTIFIER)

    • santis

      I know that it is probably too late, but have had same problem. When using MariaDB JDBC connector with MariaDB database I have had to set in jetty.xml:
      useMysqlMetadata=true

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.