blob: 296af03bdebc923c91677d1f2fb882f1c95fb82c [file] [log] [blame]
<!DOCTYPE html>
<!--
| Generated by Apache Maven Doxia Site Renderer 1.8.1
| Rendered using Apache Maven Fluido Skin 1.6
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="author" content="Olivier Lamy" />
<meta name="Date-Creation-yyyymmdd" content="20130103" />
<meta http-equiv="Content-Language" content="en" />
<title>Archiva Documentation &#x2013; Installing Standalone Distribution of Apache Archiva</title>
<link rel="stylesheet" href="../css/apache-maven-fluido-1.6.min.css" />
<link rel="stylesheet" href="../css/site.css" />
<link rel="stylesheet" href="../css/print.css" media="print" />
<script type="text/javascript" src="../js/apache-maven-fluido-1.6.min.js"></script>
<!-- Google Analytics -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-140879-5']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="topBarDisabled">
<a href="https://github.com/apache/archiva">
<img style="position: absolute; top: 0; right: 0; border: 0; z-index: 10000;"
src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png"
alt="Fork me on GitHub">
</a>
<div class="container-fluid">
<div id="banner">
<div class="pull-left"><a href="http://archiva.apache.org/" id="bannerLeft"><img src="http://archiva.apache.org/images/archiva.png" alt="Apache Archiva"/></a></div>
<div class="pull-right"><a href="http://www.apache.org/" id="bannerRight"><img src="https://www.apache.org/images/asf_logo_wide_2016.png" alt="Apache Software Foundation"/></a></div>
<div class="clear"><hr/></div>
</div>
<div id="breadcrumbs">
<ul class="breadcrumb">
<li class=""><a href="https://www.apache.org" class="externalLink" title="Apache">Apache</a><span class="divider">/</span></li>
<li class=""><a href="../../../index.html" title="Archiva">Archiva</a><span class="divider">/</span></li>
<li class=""><a href="../index.html" title="Archiva Documentation">Archiva Documentation</a><span class="divider">/</span></li>
<li class="active ">Installing Standalone Distribution of Apache Archiva</li>
<li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2019-11-30</li>
<li id="projectVersion" class="pull-right">Version: 3.0.0-SNAPSHOT</li>
</ul>
</div>
<div class="row-fluid">
<div id="leftColumn" class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">Introduction</li>
<li><a href="../quick-start.html" title="Quick Start"><span class="none"></span>Quick Start</a> </li>
<li><a href="../tour/index.html" title="Feature Tour"><span class="none"></span>Feature Tour</a> </li>
<li><a href="../release-notes.html" title="Release Notes"><span class="none"></span>Release Notes</a> </li>
<li><a href="../../../download.html" title="Downloads"><span class="none"></span>Downloads</a> </li>
<li class="nav-header">Users Guide</li>
<li><a href="../userguide/browsing.html" title="Browsing"><span class="none"></span>Browsing</a> </li>
<li><a href="../userguide/searching.html" title="Searching"><span class="none"></span>Searching</a> </li>
<li><a href="../userguide/delete-artifact.html" title="Deleting an Artifact"><span class="none"></span>Deleting an Artifact</a> </li>
<li><a href="../userguide/using-repository.html" title="Using as a repository"><span class="none"></span>Using as a repository</a> </li>
<li><a href="../userguide/deploy.html" title="Deploying to repository"><span class="none"></span>Deploying to repository</a> </li>
<li><a href="../userguide/virtual-repositories.html" title="Configuring Virtual Repositories"><span class="none"></span>Configuring Virtual Repositories</a> </li>
<li><a href="../userguide/rss.html" title="Rss Feeds in Archiva"><span class="none"></span>Rss Feeds in Archiva</a> </li>
<li><a href="../userguide/querying-artifacts.html" title="Querying Artifacts"><span class="none"></span>Querying Artifacts</a> </li>
<li class="nav-header">Administrators Guide</li>
<li><a href="../adminguide/installing.html" title="Installing Archiva"><span class="icon-chevron-down"></span>Installing Archiva</a>
<ul class="nav nav-list">
<li class="active"><a href="#"><span class="none"></span>Installing Standalone</a>
</li>
<li><a href="../adminguide/webapp.html" title="Installing as a WAR"><span class="none"></span>Installing as a WAR</a> </li>
<li><a href="../adminguide/upgrade.html" title="Upgrading to a New Version"><span class="none"></span>Upgrading to a New Version</a> </li>
</ul>
</li>
<li><a href="../adminguide/databases.html" title="Databases"><span class="none"></span>Databases</a> </li>
<li><a href="../adminguide/repositories-content-storage.html" title="Repositories Content Storage"><span class="none"></span>Repositories Content Storage</a> </li>
<li><a href="../adminguide/security.html" title="Security"><span class="icon-chevron-right"></span>Security</a> </li>
<li><a href="../adminguide/configuration.html" title="Archiva Configuration"><span class="icon-chevron-right"></span>Archiva Configuration</a> </li>
<li><a href="../adminguide/webservices/rest.html" title="REST Apis"><span class="none"></span>REST Apis</a> </li>
<li><a href="../adminguide/configuration-files.html" title="Configuration Files"><span class="none"></span>Configuration Files</a> </li>
<li><a href="../adminguide/system-status.html" title="System Status"><span class="none"></span>System Status</a> </li>
<li><a href="../adminguide/logging.html" title="Log Files"><span class="icon-chevron-right"></span>Log Files</a> </li>
<li><a href="../adminguide/reports.html" title="Reports"><span class="none"></span>Reports</a> </li>
<li class="nav-header">Customising Archiva</li>
<li><a href="../customising/writing-consumer.html" title="Writing a Consumer Plugin"><span class="none"></span>Writing a Consumer Plugin</a> </li>
<li class="nav-header">More Information</li>
<li><a href="https://cwiki.apache.org/confluence/display/ARCHIVA/Index" class="externalLink" title="Archiva Wiki"><span class="none"></span>Archiva Wiki</a> </li>
<li class="nav-header">ASF</li>
<li><a href="https://www.apache.org/foundation/how-it-works.html" class="externalLink" title="How Apache Works"><span class="none"></span>How Apache Works</a> </li>
<li><a href="https://www.apache.org/foundation/" class="externalLink" title="Foundation"><span class="none"></span>Foundation</a> </li>
<li><a href="https://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsoring Apache"><span class="none"></span>Sponsoring Apache</a> </li>
<li><a href="https://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks"><span class="none"></span>Thanks</a> </li>
<li class="nav-header">Project Documentation</li>
<li><a href="../project-info.html" title="Project Information"><span class="icon-chevron-right"></span>Project Information</a> </li>
</ul>
<form id="search-form" action="https://www.google.com/search" method="get" >
<input value="https://archiva.apache.org/docs/3.0.0-SNAPSHOT/" name="sitesearch" type="hidden"/>
<input class="search-query" name="q" id="query" type="text" />
</form>
<script type="text/javascript">asyncJs( 'https://cse.google.com/brand?form=search-form' )</script>
<hr />
<div id="poweredBy">
<div class="clear"></div>
<div class="clear"></div>
<div id="twitter">
<a href="https://twitter.com/archiva" class="twitter-follow-button" data-show-count="false" data-align="left" data-size="medium" data-show-screen-name="true" data-lang="en">Follow archiva</a>
<script type="text/javascript">!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
<div class="clear"></div>
<div class="clear"></div>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="../images/logos/maven-feather.png" /></a>
</div>
</div>
</div>
<div id="bodyColumn" class="span10" >
<div class="section">
<h2><a name="Installing_Standalone_Distribution_of_Apache_Archiva"></a>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><a name="Running_Archiva"></a>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 class="externalLink" href="http://jira.codehaus.org/browse/MRM-1467"> MRM-1467</a> for more details.</p>
<p><b>NOTE</b>: since 1.4-M3 Archiva is now available on / (ROOT) context.</p>
<p>If you want to use an other context path, you must edit the file in contexts/archiva.xml</p>
<div class="source"><pre class="prettyprint">&lt;Configure class=&quot;org.eclipse.jetty.webapp.WebAppContext&quot;&gt;
&lt;!-- contextPath used --&gt;
&lt;Set name=&quot;contextPath&quot;&gt;/&lt;/Set&gt;
&lt;Set name=&quot;war&quot;&gt;&lt;SystemProperty name=&quot;jetty.home&quot; default=&quot;.&quot;/&gt;/apps/archiva&lt;/Set&gt;
&lt;Set name=&quot;extractWAR&quot;&gt;false&lt;/Set&gt;
&lt;Set name=&quot;copyWebDir&quot;&gt;false&lt;/Set&gt;
&lt;/Configure&gt;</pre></div></div>
<div class="section">
<h3><a name="Installing_as_a_Service_on_Linux"></a>Installing as a Service on Linux</h3>
<p>On Linux, the <tt>bin/archiva</tt> script is suitable for linking or copying to <tt>/etc/init.d/archiva</tt> and running as <tt>root</tt>, as long as the <tt>RUN_AS_USER</tt> environment variable is set within the script. This will allow you to start and stop the service with:</p>
<div class="source"><pre class="prettyprint">$ service archiva start
$ service archiva stop</pre></div>
<div class="section">
<h4><a name="Starting_on_boot_for_RedHat-based_systems"></a>Starting on boot for RedHat-based systems</h4>
<p>The startup script is enabled to <tt>chkconfig</tt>. Run the following as <tt>root</tt>:</p>
<div class="source"><pre class="prettyprint">$ chkconfig --add archiva
$ chkconfig archiva on</pre></div></div>
<div class="section">
<h4><a name="Starting_on_boot_for_Debian.2FUbuntu-based_systems"></a>Starting on boot for Debian/Ubuntu-based systems</h4>
<p>Debian-based systems come with a script to create appropriate <tt>rc.d</tt> links for a startup script:</p>
<div class="source"><pre class="prettyprint">$ update-rc.d archiva defaults 80</pre></div></div></div>
<div class="section">
<h3><a name="Installing_as_a_Service_on_Windows"></a>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>
<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>Note on last Windows version, you need to configure correctly path to your java executable. In wrapper.conf file:</p>
<div>
<pre>wrapper.java.command=fullpath to your java executable</pre></div>
<p>You can later remove the service with:</p>
<div>
<pre>.\bin\archiva.bat remove</pre></div></div>
<div class="section">
<h3><a name="Installing_as_a_Service_on_Mac_OS_X"></a>Installing as a Service on Mac OS X</h3>
<p>On OS X, you can use <tt>launchd</tt> to run a service. Create the following as root in <tt>/Library/LaunchDaemons/org.apache.archiva.plist</tt>:</p>
<div class="source"><pre class="prettyprint">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot;
&quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;
&lt;plist version=&quot;1.0&quot;&gt;
&lt;dict&gt;
&lt;key&gt;Label&lt;/key&gt;
&lt;string&gt;org.apache.archiva&lt;/string&gt;
&lt;key&gt;ProgramArguments&lt;/key&gt;
&lt;array&gt;
&lt;string&gt;/Applications/Archiva/apache-archiva-3.0.0-SNAPSHOT/bin/archiva&lt;/string&gt;
&lt;string&gt;console&lt;/string&gt;
&lt;/array&gt;
&lt;key&gt;Disabled&lt;/key&gt;
&lt;false/&gt;
&lt;key&gt;RunAtLoad&lt;/key&gt;
&lt;true/&gt;
&lt;key&gt;UserName&lt;/key&gt;
&lt;string&gt;archiva&lt;/string&gt;
&lt;key&gt;StandardOutPath&lt;/key&gt;
&lt;string&gt;/Applications/Archiva/apache-archiva-3.0.0-SNAPSHOT/logs/launchd.log&lt;/string&gt;
&lt;!-- Optional - store data separate from installation (see below) --&gt;
&lt;key&gt;EnvironmentVariables&lt;/key&gt;
&lt;dict&gt;
&lt;key&gt;ARCHIVA_BASE&lt;/key&gt;
&lt;string&gt;/Users/archiva/Library/Archiva&lt;/string&gt;
&lt;/dict&gt;
&lt;!-- Optional: force it to keep running
&lt;key&gt;KeepAlive&lt;/key&gt;
&lt;true/&gt;
--&gt;
&lt;/dict&gt;
&lt;/plist&gt;</pre></div>
<p>To install the service, run the following:</p>
<div class="source"><pre class="prettyprint">$ sudo chown root:wheel /Library/LaunchDaemons/org.apache.archiva.plist
$ sudo launchctl load -w /Library/LaunchDaemons/org.apache.archiva.plist</pre></div>
<p>Start and stop the service with:</p>
<div class="source"><pre class="prettyprint">$ sudo launchctl start org.apache.archiva.plist
$ sudo launchctl stop org.apache.archiva.plist</pre></div>
<p>To uninstall the service:</p>
<div class="source"><pre class="prettyprint">$ sudo launchctl unload -w /Library/LaunchDaemons/org.apache.archiva.plist</pre></div></div>
<div class="section">
<h3><a name="Separating_the_base_from_the_installation"></a>Separating the base from the installation</h3>
<p>The standalone installation of Archiva is capable of separating its configuration from installation in much the same way Tomcat does.</p>
<p>This is achieved by the following steps:</p>
<ol style="list-style-type: decimal">
<li>Create the base location. For example, you might install Archiva in <tt>/opt/archiva-2.0</tt> and the data in <tt>/var/archiva</tt>. Create the directories <tt>/var/archiva/logs</tt>, <tt>/var/archiva/data</tt>, <tt>/var/archiva/temp</tt> and <tt>/var/archiva/conf</tt>.</li>
<li><b>Copy</b> (<i>move will fail</i>) the configuration files from the Archiva installation (e.g. <tt>/opt/archiva-2.0/conf</tt> to the new location (e.g. <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>(Optionally, leave a README file in the old conf location as a reminder of where you moved the config files.)</li>
<li>Set the environment variable <tt>ARCHIVA_BASE</tt> to the new location (e.g. <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><a name="Configuring_Archiva"></a>Configuring Archiva</h3>
<p>Archiva's configuration is loaded from the following files, in order of precedence:</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 its configuration, all configuration is stored in 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><a name="Database"></a>Database</h3>
<p>By default, Archiva uses embedded <a class="externalLink" 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 style="list-style-type: decimal">
<li>Place the jar containing the JDBC driver in the <tt>lib</tt> directory of the Archiva installation.</li>
<li>Edit <tt>conf/wrapper.conf</tt> to add it in the jetty classpath
<div class="source"><pre class="prettyprint"> Find lines with:
wrapper.java.classpath.x=%REPO_DIR%/tomcat-juli-7.0.34.jar
Add one
wrapper.java.classpath.x+1=%REPO_DIR%/yourjdbcdriver.jar
</pre></div></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 class="externalLink" href="http://cwiki.apache.org/confluence/display/ARCHIVA/Archiva+with+MySQL">Archiva with MySQL</a> for more details.</p>
<div class="source"><pre class="prettyprint"> &lt;!-- omitted xml --&gt;
&lt;!-- Users / Security Database --&gt;
&lt;New id=&quot;users&quot; class=&quot;org.eclipse.jetty.plus.jndi.Resource&quot;&gt;
&lt;Arg&gt;jdbc/users&lt;/Arg&gt;
&lt;Arg&gt;
&lt;New class=&quot;org.apache.tomcat.jdbc.pool.DataSource&quot;&gt;
&lt;Set name=&quot;driverClassName&quot;&gt;com.mysql.jdbc.Driver&lt;/Set&gt;
&lt;Set name=&quot;url&quot;&gt;jdbc:mysql://localhost/archiva&lt;/Set&gt;
&lt;Set name=&quot;username&quot;&gt;&lt;/Set&gt;
&lt;Set name=&quot;password&quot;&gt;&lt;/Set&gt;
&lt;Set name=&quot;initialSize&quot;&gt;15&lt;/Set&gt;
&lt;!-- depends on your concurrent users numbers --&gt;
&lt;Set name=&quot;maxActive&quot;&gt;30&lt;/Set&gt;
&lt;Set name=&quot;maxWait&quot;&gt;10000&lt;/Set&gt;
&lt;Set name=&quot;removeAbandoned&quot;&gt;true&lt;/Set&gt;
&lt;Set name=&quot;logAbandoned&quot;&gt;true&lt;/Set&gt;
&lt;Set name=&quot;removeAbandonedTimeout&quot;&gt;10000&lt;/Set&gt;
&lt;Set name=&quot;testOnBorrow&quot;&gt;true&lt;/Set&gt;
&lt;!-- very rigourous sql query validation --&gt;
&lt;Set name=&quot;validationQuery&quot;&gt;select 1&lt;/Set&gt;
&lt;/New&gt;
&lt;/Arg&gt;
&lt;/New&gt;
&lt;!-- omitted xml --&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 class="externalLink" 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 class="section">
<h3><a name="Installing_with_Puppet"></a>Installing with Puppet</h3>
<p>If you use Puppet to manage your infrastructure, you can use a third-party Puppet module to install Archiva. This will take care of adding the required users, databases and configuration based on official release tarballs.</p>
<ul>
<li><a class="externalLink" href="https://forge.puppetlabs.com/maestrodev/archiva"> Puppet module for Apache Archiva</a></li></ul></div></div>
</div>
</div>
</div>
<hr/>
<footer>
<div class="container-fluid">
<div class="row-fluid">
<div class="row">
<div class="span6 offset1">Apache Archiva, Archiva, Apache, the Apache feather logo, and the Apache Archiva project logos are trademarks of The Apache Software Foundation.</div>
</div>
<div class="row">
&nbsp;
</div>
<div class="row">
<div class="span6 offset2">
<p>
<a href="https://archiva.apache.org/docs/3.0.0-SNAPSHOT/privacy-policy.html">Privacy Policy</a>
</p>
</div>
</div>
</div>
<div id="ohloh" class="pull-right">
<script type="text/javascript" src="https://www.ohloh.net/p/6670/widgets/project_thin_badge.js"></script>
</div>
</div>
</footer>
</body>
</html>