Help us understand the problem. What is going on with this article?

Centos7にApache Archivaをインストール

centos7にApacheArchivaをインストールした時のメモ

※記載時点の最新バージョンは2.2.5

インストール

wget https://ftp.jaist.ac.jp/pub/apache/archiva/2.2.5/binaries/apache-archiva-2.2.5-bin.tar.gz

tar -xvzpf apache-archiva-2.2.5-bin.tar.gz
mkdir -p /opt/archiva/2.2.5
mv apache-archiva-2.2.5/* /opt/archiva/2.2.5/
ln -s /opt/archiva/2.2.5/ /opt/archiva/current

ポートの変更

 8080ポートは別のサービスが使用しているので8082ポートに変更

vi /opt/archiva/2.2.5/conf/jetty.xml

一部抜粋

    <!-- =========================================================== -->
    <!-- Set connectors                                              -->
    <!-- =========================================================== -->
    <!-- One of each type!                                           -->
    <!-- =========================================================== -->

    <!-- Use this connector for many frequently idle connections
         and for threadless continuations.
    -->
    <Call name="addConnector">
      <Arg>
          <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
            <Set name="host"><SystemProperty name="jetty.host"/></Set>
#            <Set name="port"><SystemProperty name="jetty.port" default="8080"/></Set>
            <Set name="port"><SystemProperty name="jetty.port" default="8082"/></Set>
            <Set name="maxIdleTime">30000</Set>
            <Set name="Acceptors">2</Set>
            <Set name="statsOn">false</Set>
            <Set name="confidentialPort">8443</Set>
            <Set name="lowResourcesConnections">5000</Set>
            <Set name="lowResourcesMaxIdleTime">5000</Set>
          </New>
      </Arg>
    </Call>

パスを通す。

vi ~/.bash_profile

最終行に追加

#### ARCHIVA ADD #########################
export ARCHIVA_HOME=/opt/archiva/current
export PATH=$PATH:$ARCHIVA_HOME/bin
#### ARCHIVA ADD #########################

プロファイルの再読み込み

 source  ~/.bash_profile

起動

archiva start

8082ポートにアクセスしてApacheArchivaのページが表示されれば成功です!

サービスとして起動する。

/etc/systemd/system/ApacheArchiva.serviceを作成する。

vi /etc/systemd/system/ApacheArchiva.service
[Unit]
Description = Apache Archiva

[Service]
ExecStart = /opt/archiva/current/bin/archiva start
ExecStop = /opt/archiva/current/bin/archiva stop
RemainAfterExit=yes
Type = oneshot

[Install]
WantedBy = multi-user.target

サービスとして認識されたか確認

sudo systemctl list-unit-files --type=service | grep Apache
ApacheArchiva.service                          disabled

サービスを有効にする。

sudo systemctl enable ApacheArchiva
#サービス開始
sudo systemctl start ApacheArchiva

#状態確認
sudo systemctl status ApacheArchiva
● ApacheArchiva.service - Apache Archiva
   Loaded: loaded (/etc/systemd/system/ApacheArchiva.service; enabled; vendor preset: disabled)
   Active: active (exited) since 木 2020-08-06 09:32:33 JST; 2min 41s ago
  Process: 759 ExecStart=/opt/archiva/current/bin/archiva start (code=exited, status=0/SUCCESS)
 Main PID: 759 (code=exited, status=0/SUCCESS)
    Tasks: 78
   Memory: 511.6M
   CGroup: /system.slice/ApacheArchiva.service
           tq920 /opt/archiva/2.2.5/bin/./wrapper-linux-x86-64 /opt/archiva/current/conf/wrapper.conf wrapper.syslog.ident=archiva wrapper.pidfile=/opt/archiva/current/logs/archiva.pid wrapper.daemonize=TRUE wrapper.lockfile=/var/lock...
           mq954 java -Dappserver.home=. -Dappserver.base=. -Djetty.logs=./logs -Djava.io.tmpdir=./temp -DAsyncLoggerConfig.WaitStrategy=Block -Darchiva.repositorySessionFactory.id=jcr -Darchiva.cassandra.configuration.file=./conf/arc...

参考サイト

http://www.ujp.jp/modules/tech_regist2/?Apache%2FArchiva%2F2.2.1%2F01%2Finstall
https://qiita.com/DQNEO/items/0b5d0bc5d3cf407cb7ff
https://enakai00.hatenablog.com/entry/20130917/1379374797
https://qiita.com/cmwig65/items/3386a061aeb3d2f81b81

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away