Author: Justin Lin
Date: 2010/02/24
Description:
介紹如何佈署Archiva到Tomcat中,在APACHE-ARCHIVA官方網站上有兩種安裝方式,一種是包含伺服器的安裝包一種是獨立的WAR檔。這裡介紹的是如何佈署WAR檔並且設定資料庫、REPOSITORY位置、與ARCHIVA所需的環境變數。
Precondition:
1. Apache-Tomcat 6.0
2. Apahce-Archiva WAR(文件撰寫時的最新版本為1.3)
3. Derby-10.1.3.1
4. Javamail API 1.4.2
5. Activation 1.1.1
Step:
1. 將Derby、Javamail、Activation 三個JAR檔複製到{TOMCAT_HOME}/lib下
2. 建立目錄
{TOMCAT_HOME}/archiva/database // Derby database file location
{TOMCAT_HOME}/archiva/repository // Archiva repository location
3. 建立archiva.xml設定檔(Tomcat context configuration file)
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/archiva"
docBase="${catalina.home}/archiva/apache-archiva-1.3.war">
<Resource name="jdbc/users" auth="Container" type="javax.sql.DataSource"
username="sa"
password=""
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:${catalina.home}/archiva/database/users;create=true" />
<Resource name="jdbc/archiva" auth="Container" type="javax.sql.DataSource"
username="sa"
password=""
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:${catalina.home}/archiva/database/archiva;create=true" />
<Resource name="mail/Session" auth="Container"
type="javax.mail.Session"
mail.smtp.host="localhost"/>
</Context>
4. 移動archiva.xml到{TOMCAT_HOME}/conf/Catalina/localhost下
5. 修改{ARCHIVA_WAR}/WEB-INF/classes/application.properties
user.agent=Apache Archiva/1.3
appserver.home=%CATALINA_HOME%
appserver.base=%CATALINA_HOME%
6. 修改{TOMCAT_HOME}/bin/catalina.bat加入下方設定
set JAVA_OPTS="-Dappserver.home=%CATALINA_HOME% -Dappserver.base=%CATALINA_HOME%"
7. 啟動Tomcat-6.0: {TOMCAT_HOME}/bin/startup.bat
8. 開啟瀏覽器: http://localhost:8080/archiva
9. 點選Repositories 修改Internal and Snapshot 的Repository Directory
10. 佈署完成
Reference:
1. Archiva Offical Site: http://archiva.apache.org/
2. Installing Apache Archiva as a Web Application: http://archiva.apache.org/docs/1.3/adminguide/webapp.html
沒有留言:
張貼留言