------ Installing Standalone Distribution of Apache Archiva ------ Installing Standalone Distribution of Apache Archiva Installing the standalone distribution of Archiva is quite simple - for an example, see the {{{../quick-start.html} Quick Start}} guide. However, the best way to use this installation technique is to separate the configuration from the installation to make it easy to upgrade to newer versions in the future. * Running Archiva Archiva can be run by executing: * <<>>, or <<>> for windows (select the one for your environment). The argument can be <<>> to run interactively, or <<>> to run in the background (in this case, run the script with <<>> to later stop the server). The logs are available in the <<>> directory where Archiva is installed. [] * Installing as a Service on Windows On Windows, to use the <<>> and <<>> commands you must first install it as a service. This is done by running: ---- .\bin\archiva install ---- You can then use the <<>> and <<>> commands as well as the traditional Windows service management console to manage the Archiva service. This procedure installs the service to run as the local system user. You must ensure that it has access to read the installation, and to write to the logs and data directories. You can later remove the service with: ---- .\bin\archiva remove ---- * Separating the base from the installation The standalone instance of Archiva uses the Plexus application server, which is capable of separating it's configuration from installation, in much the same way Tomcat does for example. This is achieved by the following steps: [[1]] Creating the base location. For example, you might install Archiva in <<>> and the data in <<>>. Create the directories <<>>, <<>> and <<>>. [[2]] Copy the configuration files from the Archiva installation (eg <<>> to the new location (eg. <<>>). If you've previously run Archiva, you may need to edit <<>> to change the location of the repositories [[3]] Set the environment variable <<>> to the data location (eg. <<>>). In bash, be sure to export the variable. [[4]] Start Archiva standalone as described above from the installation location * Configuring Archiva Archiva's configuration is loaded from the following files, in order of most precedent: * <<<~/.m2/archiva.xml>>> * <<<$ARCHIVA_BASE/conf/archiva.xml>>> * <<>> in the Archiva installation When Archiva saves it's configuration, all configuration is stored to a single file. The file chosen is by the following rules: * If <<<~/.m2/archiva.xml>>> exists, it is saved there * Otherwise, if <<<$ARCHIVA_BASE/conf/archiva.xml>>> exists, it is saved there * If neither apply, it is saved to <<<~/.m2/archiva.xml>>>. The configuration will never be saved in the Archiva installation directory if you are using a separate base directory. Note that the configuration can be edited, but only when Archiva is not running as it will not reload a changed configuration file, and will save over it if something is changed in the web interface. * Database By default, Archiva uses embedded {{{http://db.apache.org/derby}Apache Derby}} to store the user information. It can be configured to use an external database by providing a JDBC driver and editing the <<>> file. [[1]] Place the jar containing the JDBC driver in the <<>> directory of the Archiva installation. [[2]] Edit <<>>, providing the JDBC driver class name, database url, username, and password. [] The example below uses Mysql for the database server. You can take a look at {{{http://cwiki.apache.org/confluence/display/ARCHIVA/Archiva+with+MySQL}Archiva with MySQL}} for more details. +------+ ... jdbc/archiva localhost archiva archiva sa jdbc/archivaShutdown localhost archiva archiva sa jdbc/users localhost redback archiva sa jdbc/usersShutdown jdbc:mysql://localhost/redback archiva sa ... +------+ More information about using Derby Network Server as an external user database for Archiva can be found on the wiki: {{{http://cwiki.apache.org/confluence/display/ARCHIVA/Archiva+User+DB+on+Derby+Network+Server} Archiva User DB on Derby Network Server}}