blob: d66529f0e44aaa0fd2f97aeb33605bf605b80018 [file] [log] [blame]
<!DOCTYPE html>
<!--
| Generated by Apache Maven Doxia
| Rendered using Apache Maven Fluido Skin 1.3.1
-->
<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 name="Date-Revision-yyyymmdd" content="20170513" />
<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.3.1.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.3.1.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">
<div class="container-fluid">
<div id="banner">
<div class="pull-left">
<a href="../../../" id="bannerLeft">
<img src="../../../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="http://www.apache.org/" class="externalLink" title="Apache">
Apache</a>
<span class="divider">/</span>
</li>
<li class="">
<a href="../" title="Apache Archiva">
Apache Archiva</a>
<span class="divider">/</span>
</li>
<li class="">
<a href="../../../index.html" title="Apache Archiva">
Apache Archiva</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: 2017-05-13</li>
<li id="projectVersion" class="pull-right">
Version: 2.2.3
</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">
<i class="none"></i>
Quick Start</a>
</li>
<li>
<a href="../tour/index.html" title="Feature Tour">
<i class="none"></i>
Feature Tour</a>
</li>
<li>
<a href="../release-notes.html" title="Release Notes">
<i class="none"></i>
Release Notes</a>
</li>
<li>
<a href="../../../download.html" title="Downloads">
<i class="none"></i>
Downloads</a>
</li>
<li class="nav-header">Users Guide</li>
<li>
<a href="../userguide/browsing.html" title="Browsing">
<i class="none"></i>
Browsing</a>
</li>
<li>
<a href="../userguide/searching.html" title="Searching">
<i class="none"></i>
Searching</a>
</li>
<li>
<a href="../userguide/delete-artifact.html" title="Deleting an Artifact">
<i class="none"></i>
Deleting an Artifact</a>
</li>
<li>
<a href="../userguide/using-repository.html" title="Using as a repository">
<i class="none"></i>
Using as a repository</a>
</li>
<li>
<a href="../userguide/deploy.html" title="Deploying to repository">
<i class="none"></i>
Deploying to repository</a>
</li>
<li>
<a href="../userguide/virtual-repositories.html" title="Configuring Virtual Repositories">
<i class="none"></i>
Configuring Virtual Repositories</a>
</li>
<li>
<a href="../userguide/rss.html" title="Rss Feeds in Archiva">
<i class="none"></i>
Rss Feeds in Archiva</a>
</li>
<li>
<a href="../userguide/querying-artifacts.html" title="Querying Artifacts">
<i class="none"></i>
Querying Artifacts</a>
</li>
<li class="nav-header">Administrators Guide</li>
<li>
<a href="../adminguide/installing.html" title="Installing Archiva">
<i class="icon-chevron-down"></i>
Installing Archiva</a>
<ul class="nav nav-list">
<li class="active">
<a href="#"><i class="none"></i>Installing Standalone</a>
</li>
<li>
<a href="../adminguide/webapp.html" title="Installing as a WAR">
<i class="none"></i>
Installing as a WAR</a>
</li>
<li>
<a href="../adminguide/upgrade.html" title="Upgrading to a New Version">
<i class="none"></i>
Upgrading to a New Version</a>
</li>
</ul>
</li>
<li>
<a href="../adminguide/databases.html" title="Databases">
<i class="none"></i>
Databases</a>
</li>
<li>
<a href="../adminguide/repositories-content-storage.html" title="Repositories Content Storage">
<i class="none"></i>
Repositories Content Storage</a>
</li>
<li>
<a href="../adminguide/security.html" title="Security">
<i class="icon-chevron-right"></i>
Security</a>
</li>
<li>
<a href="../adminguide/configuration.html" title="Archiva Configuration">
<i class="icon-chevron-right"></i>
Archiva Configuration</a>
</li>
<li>
<a href="../adminguide/webservices/rest.html" title="REST Apis">
<i class="none"></i>
REST Apis</a>
</li>
<li>
<a href="../adminguide/configuration-files.html" title="Configuration Files">
<i class="none"></i>
Configuration Files</a>
</li>
<li>
<a href="../adminguide/system-status.html" title="System Status">
<i class="none"></i>
System Status</a>
</li>
<li>
<a href="../adminguide/logging.html" title="Log Files">
<i class="icon-chevron-right"></i>
Log Files</a>
</li>
<li>
<a href="../adminguide/reports.html" title="Reports">
<i class="none"></i>
Reports</a>
</li>
<li class="nav-header">Customising Archiva</li>
<li>
<a href="../customising/writing-consumer.html" title="Writing a Consumer Plugin">
<i class="none"></i>
Writing a Consumer Plugin</a>
</li>
<li class="nav-header">More Information</li>
<li>
<a href="http://cwiki.apache.org/confluence/display/ARCHIVA/Index" class="externalLink" title="Archiva Wiki">
<i class="none"></i>
Archiva Wiki</a>
</li>
<li class="nav-header">ASF</li>
<li>
<a href="http://www.apache.org/foundation/how-it-works.html" class="externalLink" title="How Apache Works">
<i class="none"></i>
How Apache Works</a>
</li>
<li>
<a href="http://www.apache.org/foundation/" class="externalLink" title="Foundation">
<i class="none"></i>
Foundation</a>
</li>
<li>
<a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsoring Apache">
<i class="none"></i>
Sponsoring Apache</a>
</li>
<li>
<a href="http://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks">
<i class="none"></i>
Thanks</a>
</li>
<li class="nav-header">Project Documentation</li>
<li>
<a href="../project-info.html" title="Project Information">
<i class="icon-chevron-right"></i>
Project Information</a>
</li>
</ul>
<form id="search-form" action="http://www.google.com/search" method="get" >
<input value="http://archiva.apache.org/docs/2.2.3/" name="sitesearch" type="hidden"/>
<input class="search-query" name="q" id="query" type="text" />
</form>
<script type="text/javascript" src="http://www.google.com/coop/cse/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" >
<!-- Licensed to the Apache Software Foundation (ASF) under one --><!-- or more contributor license agreements. See the NOTICE file --><!-- distributed with this work for additional information --><!-- regarding copyright ownership. The ASF licenses this file --><!-- to you under the Apache License, Version 2.0 (the --><!-- "License"); you may not use this file except in compliance --><!-- with the License. You may obtain a copy of the License at --><!-- --><!-- http://www.apache.org/licenses/LICENSE-2.0 --><!-- --><!-- Unless required by applicable law or agreed to in writing, --><!-- software distributed under the License is distributed on an --><!-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --><!-- KIND, either express or implied. See the License for the --><!-- specific language governing permissions and limitations --><!-- under the License. --><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>&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>$ 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>$ chkconfig --add archiva
$ chkconfig archiva on</pre></div></div>
<div class="section">
<h4><a name="Starting_on_boot_for_DebianUbuntu-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>$ 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>&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-2.2.3/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-2.2.3/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>$ 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>$ 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>$ 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> 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> &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">
<p >Copyright &copy; 2006&#x2013;2017
<a href="http://www.apache.org/">The Apache Software Foundation</a>.
All rights reserved.
</p>
</div>
<div class="row span12">Apache Archiva :: Documentation, Archiva :: Documentation, Apache, the Apache feather logo, and the Apache Archiva :: Documentation project logos are trademarks of The Apache Software Foundation.</div>
<div class="row span12">
<a href="http://archiva.apache.org/docs/2.2.3/privacy-policy.html">Privacy Policy</a>
</div>
<div id="ohloh" class="pull-right">
<script type="text/javascript" src="http://www.ohloh.net/p/6670/widgets/project_basic_stats.js"></script>
</div>
</div>
</footer>
</body>
</html>