blob: b15edc26986f181693c9012c0eac20f5f8ccc31c [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Archiva Documentation - Installing Standalone Distribution of Apache Archiva</title>
<style type="text/css" media="all">
@import url("../css/maven-base.css");
@import url("../css/maven-theme.css");
@import url("../css/site.css");
</style>
<link rel="stylesheet" href="../css/print.css" type="text/css" media="print" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<?xml version="1.0" encoding="UTF-8"?>
<script type="text/javascript">var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));</script>
<?xml version="1.0" encoding="UTF-8"?>
<script type="text/javascript">var pageTracker = _gat._getTracker("UA-140879-5");
pageTracker._initData();
pageTracker._trackPageview();</script>
</head>
<body class="composite">
<div id="banner">
<a href="../../" id="bannerLeft">
<img src="http://archiva.apache.org/images/archiva.png" alt="" />
</a>
<a href="http://www.apache.org/" id="bannerRight">
<img src="http://www.apache.org/images/asf_logo_wide.png" alt="" />
</a>
<div class="clear">
<hr/>
</div>
</div>
<div id="breadcrumbs">
<div class="xleft">
<a href="http://www.apache.org/">Apache</a>
&gt;
<a href="../../../">Archiva</a>
&gt;
<a href="../index.html">1.3.9</a>
</div>
<div class="xright">
&nbsp;| Last Published: 01 Jul 2014
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="leftColumn">
<div id="navcolumn">
<h5>Introduction</h5>
<ul>
<li class="none">
<a href="../quick-start.html">Quick Start</a>
</li>
<li class="none">
<a href="../tour/index.html">Feature Tour</a>
</li>
<li class="none">
<a href="../release-notes.html">Release Notes</a>
</li>
<li class="none">
<a href="http://archiva.apache.org/download.html">Downloads</a>
</li>
</ul>
<h5>Users Guide</h5>
<ul>
<li class="none">
<a href="../userguide/browsing.html">Browsing</a>
</li>
<li class="none">
<a href="../userguide/searching.html">Searching</a>
</li>
<li class="none">
<a href="../userguide/find-artifact.html">Identifying an Artifact</a>
</li>
<li class="none">
<a href="../userguide/delete-artifact.html">Deleting an Artifact</a>
</li>
<li class="none">
<a href="../userguide/using-repository.html">Using as a repository</a>
</li>
<li class="none">
<a href="../userguide/deploy.html">Deploying to repository</a>
</li>
<li class="none">
<a href="../userguide/virtual-repositories.html">Configuring Virtual Repositories</a>
</li>
<li class="none">
<a href="../userguide/rss.html">Rss Feeds in Archiva</a>
</li>
<li class="none">
<a href="../userguide/auditlog-report.html">Audit Log Report</a>
</li>
</ul>
<h5>Administrators Guide</h5>
<ul>
<li class="expanded">
<a href="../adminguide/installing.html">Installing Archiva</a>
<ul>
<li class="none">
<strong>Installing Standalone</strong>
</li>
<li class="none">
<a href="../adminguide/webapp.html">Installing as a WAR</a>
</li>
<li class="none">
<a href="../adminguide/upgrade.html">Upgrading to a New Version</a>
</li>
</ul>
</li>
<li class="none">
<a href="../adminguide/databases.html">Databases</a>
</li>
<li class="collapsed">
<a href="../adminguide/security.html">Security</a>
</li>
<li class="collapsed">
<a href="../adminguide/configuration.html">Runtime Configuration</a>
</li>
<li class="none">
<a href="../adminguide/configuration-files.html">Configuration Files</a>
</li>
<li class="collapsed">
<a href="../adminguide/logging.html">Log Files</a>
</li>
<li class="none">
<a href="../adminguide/reports.html">Reports</a>
</li>
<li class="none">
<a href="../adminguide/web-services.html">Web Services</a>
</li>
</ul>
<h5>Customising Archiva</h5>
<ul>
<li class="none">
<a href="../customising/writing-consumer.html">Writing a Consumer Plugin</a>
</li>
</ul>
<h5>More Information</h5>
<ul>
<li class="none">
<a href="http://cwiki.apache.org/confluence/display/ARCHIVA/Index">Archiva Wiki</a>
</li>
</ul>
<a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
<img alt="Built by Maven" src="../images/logos/maven-feather.png"></img>
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<div class="section"><h2>Installing Standalone Distribution of Apache Archiva</h2><p>Installing the standalone distribution of Archiva is quite simple - for an example, see the <a href="../quick-start.html"> Quick Start</a> guide.</p><p>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.</p><div class="section"><h3>Running Archiva</h3><p>Archiva can be run by executing:</p><ul><li><tt>bin/archiva</tt>, or <tt>bin\archiva.bat</tt> for Windows (select the one for your environment). The argument can be <tt>console</tt> to run interactively, or <tt>start</tt> to run in the background (in this case, run the script with <tt>stop</tt> to later stop the server). The logs are available in the <tt>logs</tt> directory where Archiva is installed.</li></ul><p>There is an issue with regard to the version of <tt>tr</tt> installed/used by default on Solaris so you might encounter a series of <tt>Bad String</tt> errors when you run the Archiva binaries in Solaris. You need to use a different version of <tt>tr</tt> in order to get it to work. See <a href="http://jira.codehaus.org/browse/MRM-1467"> MRM-1467</a> for more details.</p></div><div class="section"><h3>Installing as a Service on Windows</h3><p>On Windows, to use the <tt>start</tt> and <tt>stop</tt> commands you must first install it as a service. This is done by running:</p><div class="source"><pre>.\bin\archiva.bat install</pre></div><p>You can then use the <tt>start</tt> and <tt>stop</tt> commands as well as the traditional Windows service management console to manage the Archiva service.</p><p>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.</p><p>You can later remove the service with:</p><div class="source"><pre>.\bin\archiva.bat remove</pre></div></div><div class="section"><h3>Separating the base from the installation</h3><p>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.</p><p>This is achieved by the following steps:</p><ol type="1"><li>Creating the base location. For example, you might install Archiva in <tt>/opt/archiva-1.0</tt> and the data in <tt>/var/archiva</tt>. Create the directories <tt>/var/archiva/logs</tt>, <tt>/var/archiva/data</tt> and <tt>/var/archiva/conf</tt>.</li><li>Copy the configuration files from the Archiva installation (eg <tt>/opt/archiva-1.0/conf</tt> to the new location (eg. <tt>/var/archiva/conf</tt>). If you've previously run Archiva, you may need to edit <tt>conf/archiva.xml</tt> to change the location of the repositories</li><li>Set the environment variable <tt>ARCHIVA_BASE</tt> to the data location (eg. <tt>/var/archiva</tt>). In bash, be sure to export the variable.</li><li>Start Archiva standalone as described above from the installation location</li></ol></div><div class="section"><h3>Configuring Archiva</h3><p>Archiva's configuration is loaded from the following files, in order of most precedent:</p><ul><li><tt>~/.m2/archiva.xml</tt></li><li><tt>$ARCHIVA_BASE/conf/archiva.xml</tt></li><li><tt>conf/archiva.xml</tt> in the Archiva installation</li></ul><p>When Archiva saves it's configuration, all configuration is stored to a single file. The file chosen is by the following rules:</p><ul><li>If <tt>~/.m2/archiva.xml</tt> exists, it is saved there</li><li>Otherwise, if <tt>$ARCHIVA_BASE/conf/archiva.xml</tt> exists, it is saved there</li><li>If neither apply, it is saved to <tt>~/.m2/archiva.xml</tt>.</li></ul><p>The configuration will never be saved in the Archiva installation directory if you are using a separate base directory.</p><p>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.</p></div><div class="section"><h3>Database</h3><p>By default, Archiva uses embedded <a href="http://db.apache.org/derby">Apache Derby</a> to store the user information. It can be configured to use an external database by providing a JDBC driver and editing the <tt>jetty.xml</tt> file.</p><ol type="1"><li>Place the jar containing the JDBC driver in the <tt>lib</tt> directory of the Archiva installation.</li><li>Edit <tt>conf/jetty.xml</tt>, providing the JDBC driver class name, database url, username, and password.</li></ol><p>The example below uses Mysql for the database server. You can take a look at <a href="http://cwiki.apache.org/confluence/display/ARCHIVA/Archiva+with+MySQL">Archiva with MySQL</a> for more details.</p><div class="source"><pre> ...
&lt;!-- Archiva Database --&gt;
&lt;New id=&quot;archiva&quot; class=&quot;org.mortbay.jetty.plus.naming.Resource&quot;&gt;
&lt;Arg&gt;jdbc/archiva&lt;/Arg&gt;
&lt;Arg&gt;
&lt;New class=&quot;com.mysql.jdbc.jdbc2.optional.MysqlDataSource&quot;&gt;
&lt;Set name=&quot;serverName&quot;&gt;localhost&lt;/Set&gt;
&lt;Set name=&quot;databaseName&quot;&gt;archiva&lt;/Set&gt;
&lt;Set name=&quot;user&quot;&gt;archiva&lt;/Set&gt;
&lt;Set name=&quot;password&quot;&gt;sa&lt;/Set&gt;
&lt;/New&gt;
&lt;/Arg&gt;
&lt;/New&gt;
&lt;New id=&quot;archivaShutdown&quot; class=&quot;org.mortbay.jetty.plus.naming.Resource&quot;&gt;
&lt;Arg&gt;jdbc/archivaShutdown&lt;/Arg&gt;
&lt;Arg&gt;
&lt;New class=&quot;com.mysql.jdbc.jdbc2.optional.MysqlDataSource&quot;&gt;
&lt;Set name=&quot;serverName&quot;&gt;localhost&lt;/Set&gt;
&lt;Set name=&quot;databaseName&quot;&gt;archiva&lt;/Set&gt;
&lt;Set name=&quot;user&quot;&gt;archiva&lt;/Set&gt;
&lt;Set name=&quot;password&quot;&gt;sa&lt;/Set&gt;
&lt;/New&gt;
&lt;/Arg&gt;
&lt;/New&gt;
&lt;!-- Users / Security Database --&gt;
&lt;New id=&quot;users&quot; class=&quot;org.mortbay.jetty.plus.naming.Resource&quot;&gt;
&lt;Arg&gt;jdbc/users&lt;/Arg&gt;
&lt;Arg&gt;
&lt;New class=&quot;com.mysql.jdbc.jdbc2.optional.MysqlDataSource&quot;&gt;
&lt;Set name=&quot;serverName&quot;&gt;localhost&lt;/Set&gt;
&lt;Set name=&quot;databaseName&quot;&gt;redback&lt;/Set&gt;
&lt;Set name=&quot;user&quot;&gt;archiva&lt;/Set&gt;
&lt;Set name=&quot;password&quot;&gt;sa&lt;/Set&gt;
&lt;/New&gt;
&lt;/Arg&gt;
&lt;/New&gt;
&lt;New id=&quot;usersShutdown&quot; class=&quot;org.mortbay.jetty.plus.naming.Resource&quot;&gt;
&lt;Arg&gt;jdbc/usersShutdown&lt;/Arg&gt;
&lt;Arg&gt;
&lt;New class=&quot;com.mysql.jdbc.jdbc2.optional.MysqlDataSource&quot;&gt;
&lt;Set name=&quot;url&quot;&gt;jdbc:mysql://localhost/redback&lt;/Set&gt;
&lt;Set name=&quot;user&quot;&gt;archiva&lt;/Set&gt;
&lt;Set name=&quot;password&quot;&gt;sa&lt;/Set&gt;
&lt;/New&gt;
&lt;/Arg&gt;
&lt;/New&gt;
...</pre></div><p>More information about using Derby Network Server as an external user database for Archiva can be found on the wiki: <a href="http://cwiki.apache.org/confluence/display/ARCHIVA/Archiva+User+DB+on+Derby+Network+Server"> Archiva User DB on Derby Network Server</a></p></div></div>
</div>
</div>
<div class="clear">
<hr/>
</div>
<div id="footer">
<div class="xright">&#169;
2006-2014
The Apache Software Foundation
</div>
<div class="clear">
<hr/>
</div>
</div>
</body>
</html>