Alfresco Content Services 7.x のインストール(WAR ファイル)
はじめに
このページでは Alfresco Content Services 7.x のインストール方法を説明します。
前提として、
CentOS 8
Alfresco SSL Generator を実行済み
とします。
必ずサポート対象のバージョンを確認し、使用するようにしてください。
手順におけるバージョンについては、適宜読み替えてください。
1.事前準備
1.1 確認事項
Alfresco Content Service のサポートプラットフォームを確認してください。
https://docs.alfresco.com/content-services/latest/support/
1.2 事前準備
1.2.1 必要ファイルの入手
事前に以下のファイルを入手してください。
ファイルの入手はリックソフトのヘルプデスクに依頼ください。
インストールファイル | ファイル名 | 説明 |
|---|---|---|
Alfresco Content Services Distribution zip | alfresco-content-services-distribution-<バージョン番号>.zip | 新規インストールまたはアップグレード用の配布 zip ファイル 既存の Tomcat アプリケーションサーバーへの手動インストール用のAlfresco WAR ファイル (配布 zip ファイル内)。 この配布zipファイルには、モジュール管理ツール (MMT) およびalfresco-global.propertiesなどのサンプル拡張ファイルも含まれています。 |
Alfresco Search Services Distribution zip | alfresco-search-services-<バージョン番号>.zip | Alfresco Search Services インストールファイル。 詳細については、 Alfresco Search Services 概要 を参照してください。 |
Alfresco Office Services Module zip | alfresco-aos-module-distributionzip-<バージョン番号>.zip | Alfresco Office Services Module (AOS) を使用すると、Microsoft Office アプリケーションから Alfresco に直接アクセスできます。 |
1.2.2 事前準備のためのインストール
以下のミドルウェアをインストールします。
インストール手順についてはリックソフトサポートドキュメントも参考にしてください。
1〜5 については、それぞれの公式ドキュメント、6は Alfresco 社の GitHub リポジトリにも手順があります。
OpenJDK をインストールします
PostgreSQL をインストールします
公式ドキュメント: Linux downloads (Red Hat family)
RS サポートドキュメント: PostgreSQL のインストール(CentOS 8 でパッケージから)
ActiveMQ をインストールします
公式ドキュメント: Installation Procedure for Unix
RS サポートドキュメント: ActiveMQ のインストール
Alfresco SSL Generator を実行します
GitHub リンク: Welcome to Alfresco SSL Generator
RS サポートドキュメント: Alfresco SSL Generator の設定 (※新フォーマットを実施している前提とします)
Alfresco Transform Services をインストールします
公式ドキュメント: Install with zip
2.Tomcat のインストール
次のコマンドを実行して Tomcat の tar.gz ファイルをダウンロードします。(ここではアーカイブされたバージョンのファイルをダウンロードしています)
実行コマンド
# curl -LkOf https://ftp.jaist.ac.jp/pub/apache/tomcat/tomcat-9/v9.0.50/bin/apache-tomcat-9.0.50.tar.gzダウンロードしたファイルが破損していないか確認します(Index of /dist/tomcat/tomcat-9)
実行コマンド
# sha512sum apache-tomcat-9.0.50.tar.gz実行結果
06cd51abbeebba9385f594ed092bd30e510b6314c90c421f4be5d8bec596c6a177785efc2ce27363813f6822af89fc88a2072d7b051960e5387130faf69c447b apache-tomcat-9.0.50.tar.gzダウンロードした tar.gz ファイルを展開します。
実行コマンド
# tar zxf apache-tomcat-9.0.50.tar.gz3.Alfresco Content Services のインストール
alfresco-content-services-distribution-<バージョン番号>.zip、alfresco-aos-module-distributionzip-<バージョン番号>.zip をあらかじめサーバに配置します。
必要に応じて実行用ユーザを作成します。
実行コマンド
# useradd alfrescoデータ格納用ディレクトリを作成します。
実行コマンド
# mkdir -p /var/lib/alfresco/data \
&& chown -R alfresco:alfresco /var/lib/alfresco \
&& ls -l /var/lib/alfresco実行結果
total 0
drwxr-xr-x. 2 alfresco alfresco 6 Apr 26 06:49 dataログ格納用ディレクトリを作成します。
実行コマンド
# mkdir -p /var/log/alfresco/platform \
&& mkdir -p /var/log/alfresco/share \
&& mkdir -p /var/log/alfresco/tomcat \
&& chown -R alfresco:alfresco /var/log/alfresco \
&& ls -l /var/log/alfresco実行結果
total 0
drwxr-xr-x. 2 alfresco alfresco 6 Apr 26 06:35 platform
drwxr-xr-x. 2 alfresco alfresco 6 Apr 26 06:35 share
drwxr-xr-x. 2 alfresco alfresco 6 Apr 26 06:35 tomcatpostgres ユーザで psql コマンドを実行します
実行コマンド
# su - postgres
$ psqlデータベースを作成します
実行コマンド
postgres=# CREATE ROLE alfresco PASSWORD 'alfresco' createdb login;
postgres=# CREATE DATABASE alfresco OWNER alfresco template=template0 encoding='utf-8' lc_collate='C' lc_ctype='C';
postgres=# GRANT ALL ON DATABASE alfresco TO alfresco;
postgres ユーザからログアウトします
実行コマンド
postgres=# \q
$ exit/opt 配下に新しくディレクトリを作成し、Tomcat のディレクトリを配置します
実行コマンド
# mkdir -p /opt/alfresco/content-services \
&& mv /root/apache-tomcat-9.0.50 /opt/alfresco/content-services/tomcatalfresco-content-services-distribution-<バージョン番号>.zip ファイルを展開します
実行コマンド
# unzip alfresco-content-services-distribution-<バージョン番号>.zip -d /opt/alfresco/content-services/ \
&& ls -l /opt/alfresco/content-services/実行結果
total 8
drwxrwxr-x. 2 root root 41 Mar 11 14:40 amps
drwxrwxr-x. 2 root root 255 Mar 11 14:40 bin
drwxrwxr-x. 3 root root 138 Mar 11 14:40 keystore
drwxrwxr-x. 3 root root 60 Mar 11 14:40 licenses
-rw-rw-r--. 1 root root 292 Mar 11 14:40 README.txt
drwxr-xr-x. 9 root root 220 Apr 26 06:58 tomcat
-rw-rw-r--. 1 root root 2928 Mar 11 14:40 VERSIONS.md
drwxrwxr-x. 6 root root 58 Mar 11 14:40 web-server
alfresco-aos-module-distributionzip-<バージョン番号>.zip ファイルを展開します
実行コマンド
# unzip /root/alfresco-aos-module-distributionzip-<バージョン番号>.zip -d /opt/alfresco/content-services/amps/Tomcat のディレクトリ配下に次のディレクトリを作成します
実行コマンド
# mkdir -p /opt/alfresco/content-services/tomcat/shared/lib \
&& ls -l /opt/alfresco/content-services/tomcat/shared実行結果
total 0
drwxr-xr-x. 2 root root 6 Aug 9 05:11 lib(オプション) Share 側に amp ファイルをインストールする必要がある場合は、予めディレクトリを作成しておきます。
実行コマンド
# mkdir /opt/alfresco/content-services/amps_share/opt/alfresco/content-services/tomcat/conf/catalina.properties の次の設定値を設定します。
実行コマンド
# vi /opt/alfresco/content-services/tomcat/conf/catalina.properties編集内容
shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar
/opt/alfresco/content-services/tomcat/conf/server.xml ファイルを編集します
実行コマンド
# vi /opt/alfresco/content-services/tomcat/conf/server.xml編集内容
...
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8" ←追加
maxHttpHeaderSize="32768" ←追加
redirectPort="8443" />
(中略)
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="/var/log/alfresco/tomcat" ←編集
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
...catalina_pid 用に setenv.sh ファイルを作成する
実行コマンド
# vi /opt/alfresco/content-services/tomcat/bin/setenv.sh編集内容(クラシックフォーマットの SSL ジェネレータを使用する場合)
CATALINA_PID="$CATALINA_BASE/content-services.pid"
編集内容(新フォーマットの SSL ジェネレータを使用する場合)
CATALINA_PID="$CATALINA_BASE/content-services.pid"
export JAVA_TOOL_OPTIONS="-Dencryption.keystore.type=JCEKS
-Dencryption.cipherAlgorithm=AES/CBC/PKCS5Padding
-Dencryption.keyAlgorithm=AES
-Dencryption.keystore.location=/opt/alfresco/content-services/keystore/metadata-keystore
-Dmetadata-keystore.password=password
-Dmetadata-keystore.aliases=metadata
-Dmetadata-keystore.metadata.password=password
-Dmetadata-keystore.metadata.algorithm=AES
"
Tomcat ログの出力先を変更します
実行コマンド
# sed -i -e "s/\${catalina.base}\/logs/\/var\/log\/alfresco\/tomcat/g" /opt/alfresco/content-services/tomcat/conf/logging.propertiescatalina.out のパスを編集し、出力先を変更します。
実行コマンド
# vi /opt/alfresco/content-services/tomcat/bin/catalina.sh編集内容
CATALINA_OUT=/var/log/alfresco/tomcat/catalina.outアドオン用のディレクトリをあらかじめ作成します
実行コマンド
# mkdir -p /opt/alfresco/content-services/modules/platform /opt/alfresco/content-services/modules/share \
&& ls -l /opt/alfresco/content-services/modules/実行結果
total 0
drwxr-xr-x. 2 root root 6 8月 9 16:09 platform
drwxr-xr-x. 2 root root 6 8月 9 16:09 sharetomcat/webapp 配下のフォルダを全て削除します
実行コマンド
# rm -rf /opt/alfresco/content-services/tomcat/webapps/* \
&& ls -l /opt/alfresco/content-services/tomcat/webapps/実行結果
total 0web-server/webapps/ 配下の war ファイルを tomcat/webapp 配下に移動します
実行コマンド
# mv /opt/alfresco/content-services/web-server/webapps/* /opt/alfresco/content-services/tomcat/webapps/ \
&& ls -l /opt/alfresco/content-services/tomcat/webapps/ | grep war実行結果
-rw-rw-r--. 1 root root 214631448 Dec 27 12:45 alfresco.war
-rw-rw-r--. 1 root root 275031 Nov 15 14:09 ROOT.war
-rw-rw-r--. 1 root root 75575656 Oct 25 16:29 share.war
-rw-rw-r--. 1 root root 762845 Nov 15 14:10 _vti_bin.war
コンテンツを移動します
実行コマンド
# mv /opt/alfresco/content-services/web-server/conf/* /opt/alfresco/content-services/tomcat/conf/ \
&& mv /opt/alfresco/content-services/web-server/lib/* /opt/alfresco/content-services/tomcat/lib/ \
&& mv /opt/alfresco/content-services/web-server/shared/* /opt/alfresco/content-services/tomcat/shared/web-server フォルダを削除します
実行コマンド
# rm -rf /opt/alfresco/content-services/web-server/alfresco-global.properties ファイルを作成します
実行コマンド
# vi /opt/alfresco/content-services/tomcat/shared/classes/alfresco-global.properties編集内容(クラシックフォーマットの SSL ジェネレータを使用する場合)
###############################
## Common Alfresco Properties #
###############################
#
# Custom content and index data location
#
dir.root=/var/lib/alfresco/data
dir.keystore=/opt/alfresco/content-services/keystore/metadata-keystore
#
# Database connection properties
#
db.host=localhost
db.port=5432
#
# PostgreSQL connection (requires postgresql-8.2-504.jdbc3.jar or equivalent)
#
db.driver=org.postgresql.Driver
db.url=jdbc:postgresql://localhost:5432/alfresco
#
# URL Generation Parameters (The ${localname} token is replaced by the local server name)
#-------------
alfresco.context=alfresco
alfresco.host=${localname}
alfresco.port=8080
alfresco.protocol=http
share.context=share
share.host=${localname}
share.port=8080
share.protocol=http
### Solr indexing ###
index.subsystem.name=solr6
#solr.port=8983
solr.port.ssl=8983
solr.host=localhost
solr.base.url=/solr
transform.service.enabled=true
local.transform.service.enabled=true
transform.service.url=http://127.0.0.1:8095
localTransform.core-aio.url=http://127.0.0.1:8090
alfresco-pdf-renderer.url=${localTransform.core-aio.url}
jodconverter.url=${localTransform.core-aio.url}
img.url=${localTransform.core-aio.url}
tika.url=${localTransform.core-aio.url}
transform.misc.url=${localTransform.core-aio.url}
sfs.url=http://127.0.0.1:8099/
# ssl encryption
encryption.ssl.keystore.location=${dir.keystore}/ssl.keystore
encryption.ssl.keystore.keyMetaData.location=${dir.keystore}/ssl-keystore-passwords.properties
encryption.ssl.keystore.type=JCEKS
encryption.ssl.truststore.location=${dir.keystore}/ssl.truststore
encryption.ssl.truststore.keyMetaData.location=${dir.keystore}/ssl-truststore-passwords.properties
encryption.ssl.truststore.type=JCEKS
# secret key keystore configuration
encryption.keystore.location=${dir.keystore}/keystore
encryption.keystore.keyMetaData.location=${dir.keystore}/keystore-passwords.properties
encryption.keystore.type=JCEKS
### Auditing config
audit.enabled=true
audit.alfresco-access.enabled=true
### Enabling sub-actions
# Enable the auditing of sub-actions. Normally disabled as these values are
# not normally needed by audit configurations, but may be useful to
# developers
#audit.alfresco-access.sub-actions.enabled=true
csrf.filter.enabled=false
編集内容(新フォーマットの SSL ジェネレータを使用する場合)
###############################
## Common Alfresco Properties #
###############################
#
# Custom content and index data location
#
dir.root=/var/lib/alfresco/data
dir.keystore=/opt/alfresco/content-services/keystore/metadata-keystore
#
# Database connection properties
#
db.host=localhost
db.port=5432
#
# PostgreSQL connection (requires postgresql-8.2-504.jdbc3.jar or equivalent)
#
db.driver=org.postgresql.Driver
db.url=jdbc:postgresql://localhost:5432/alfresco
#
# URL Generation Parameters (The ${localname} token is replaced by the local server name)
#-------------
alfresco.context=alfresco
alfresco.host=${localname}
alfresco.port=8080
alfresco.protocol=http
share.context=share
share.host=${localname}
share.port=8080
share.protocol=http
### Solr indexing ###
index.subsystem.name=solr6
#solr.port=8983
solr.port.ssl=8983
solr.host=localhost
solr.base.url=/solr
transform.service.enabled=true
local.transform.service.enabled=true
transform.service.url=http://127.0.0.1:8095
localTransform.core-aio.url=http://127.0.0.1:8090
alfresco-pdf-renderer.url=${localTransform.core-aio.url}
jodconverter.url=${localTransform.core-aio.url}
img.url=${localTransform.core-aio.url}
tika.url=${localTransform.core-aio.url}
transform.misc.url=${localTransform.core-aio.url}
sfs.url=http://127.0.0.1:8099/
# ssl encryption
encryption.ssl.keystore.location=${dir.keystore}/ssl.keystore
encryption.ssl.truststore.location=${dir.keystore}/ssl.truststore
# secret key keystore configuration
encryption.keystore.location=${dir.keystore}/keystore
### Auditing config
audit.enabled=true
audit.alfresco-access.enabled=true
### Enabling sub-actions
# Enable the auditing of sub-actions. Normally disabled as these values are
# not normally needed by audit configurations, but may be useful to
# developers
#audit.alfresco-access.sub-actions.enabled=true
Alfresco SSL Generator で生成した証明書をコピーします
実行コマンド
# cp -p /root/work/alfresco-ssl-generator-master/ssl-tool/keystores/alfresco/* /opt/alfresco/content-services/keystore/metadata-keystore/権限を変更します
実行コマンド
# chown -R alfresco:alfresco /opt/alfresco/ \
&& find /opt/alfresco/ ! -user alfresco | wc -l実行結果
0amp を適用するスクリプトに実行権限を付与します
実行コマンド
# chmod u+x /opt/alfresco/content-services/bin/apply_amps.shalfresco 実行用ユーザにスイッチします
実行コマンド
# su - alfrescoスクリプトを実行します
実行コマンド
$ /opt/alfresco/content-services/bin/apply_amps.sh実行結果
/bin/java
Found installed java executable on the system
This script will apply all the AMPs in amps and amps_share to the alfresco.war and share.war files in /opt/alfresco/content-services/tomcat/webapps
Press control-c to stop this script . . .
Press any other key to continue . . . ←何かキーを押す
Module 'alfresco-aos-module' installed in '/opt/alfresco/content-services/tomcat/webapps/alfresco.war'
- Title: Alfresco Office Services Module
- Version: <バージョン番号>
- Install Date: Tue Apr 09 16:15:27 JST 2019
- Description: Allows applications that can talk to a SharePoint server to talk to your Alfresco installation
Module 'alfresco-share-services' installed in '/opt/alfresco/content-services/tomcat/webapps/alfresco.war'
- Title: Alfresco Share Services AMP
- Version: <バージョン番号>
- Install Date: Tue Apr 09 16:15:26 JST 2019
- Description: Module to be applied to alfresco.war, containing APIs for Alfresco Share
No modules are installed in this WAR file
About to clean out /opt/alfresco/content-services/tomcat/webapps/alfresco and share directories and temporary files...
Press control-c to stop this script . . .
Press any other key to continue . . . ←何かキーを押す
Cleaning temporary Alfresco files from Tomcat...
alfresco 実行用ユーザからログアウトします
実行コマンド
$ exitAlfresco Content Services を起動します
SELinux などの設定によっては、権限の関係で systemd を使用した起動に失敗する場合があります。
その場合は自社のポリシーにあわせて適宜対応してください。
実行コマンド
# su - alfresco
$ /opt/alfresco/content-services/tomcat/bin/startup.sh次の情報でログインします
項目名 | 設定値 | |
|---|---|---|
1 | URL | http://<IPアドレス>:<ポート>/share |
2 | ユーザー名 | admin |
3 | パスワード | admin |
ログインすると次のホーム画面に遷移します。
Alfresco Content Services を停止します
実行コマンド
$ /opt/alfresco/content-services/tomcat/bin/shutdown.sh
$ exitRepository 側の log4j.properties ファイルの設定を変更し、ログの出力先を変更します
実行コマンド
# vi /opt/alfresco/content-services/tomcat/webapps/alfresco/WEB-INF/classes/log4j.properties編集内容
log4j.appender.File.File=/var/log/alfresco/platform/alfresco.logShare 側の log4j.properties ファイルの設定を変更し、ログの出力先を変更します
実行コマンド
# vi /opt/alfresco/content-services/tomcat/webapps/share/WEB-INF/classes/log4j.properties編集内容
log4j.appender.File.File=/var/log/alfresco/share/share.log
TinyMCE language pack から必要な言語を選択してダウンロードし、その zip ファイルをあらかじめサーバに配置します。
実行コマンド
# curl -Lkvf https://www.tiny.cloud/tinymce-services-azure/1/i18n/download/?langs=ja -o tinymce_languages.ziptinymce_languages.zip ファイルを展開します。
実行コマンド
# unzip tinymce_languages.zip -d /opt/alfresco/content-services/tomcat/webapps/share/modules/editors/tiny_mce権限を変更します。
実行コマンド
# chown -R alfresco:alfresco /opt/alfresco/ && find /opt/alfresco/ ! -user alfresco | wc -l実行結果
0Alfresco Content Services のサービスファイルを作成します。
実行コマンド
# vi /etc/systemd/system/content-services.service編集内容
[Unit]
Description=Alfresco Content Services
After=network.target postgresql-13.service activemq.service transform-services.service
[Service]
Restart=no
Type=forking
User=alfresco
Group=alfresco
WorkingDirectory=/opt/alfresco/content-services/tomcat
PIDFile=/opt/alfresco/content-services/tomcat/content-services.pid
ExecStart=/opt/alfresco/content-services/tomcat/bin/startup.sh
ExecStop=/opt/alfresco/content-services/tomcat/bin/shutdown.sh
[Install]
WantedBy=multi-user.targetAlfresco Content Services の自動起動を設定します
実行コマンド
# systemctl daemon-reload \
&& systemctl enable content-services \
&& systemctl is-enabled content-services \
&& systemctl list-unit-files --type=service | grep content-services実行結果
Created symlink from /etc/systemd/system/multi-user.target.wants/content-services.service to /usr/lib/systemd/system/content-services.service.
enabled
content-services.service enabled再度 Alfresco Content Services を起動します
実行コマンド
# systemctl start content-services && systemctl is-active content-servicesAlfresco Search Services をインストールします
公式ドキュメント: Installing and configuring Search Services with mutual TLS
RS サポートドキュメント: Alfresco Search Services のインストール