Alfresco Content Services 6.0.x のインストール(WAR ファイル)
- 1 はじめに
- 2 1.事前準備
- 3 2.Tomcat のインストール
- 4 3.Alfresco Content Services のインストール
- 4.1 実行コマンド
- 4.2 実行コマンド
- 4.3 実行コマンド
- 4.4 実行コマンド
- 4.5 実行結果
- 4.6 実行コマンド
- 4.7 実行コマンド
- 4.8 実行コマンド
- 4.9 実行コマンド
- 4.10 実行コマンド
- 4.11 実行コマンド
- 4.12 実行結果
- 4.13 実行コマンド
- 4.14 編集内容
- 4.15 実行コマンド
- 4.16 編集内容
- 4.17 実行コマンド
- 4.18 編集内容
- 4.19 実行コマンド
- 4.20 実行結果
- 4.21 実行コマンド
- 4.22 実行結果
- 4.23 実行コマンド
- 4.24 実行コマンド
- 4.25 実行結果
- 4.26 実行コマンド
- 4.27 実行コマンド
- 4.28 実行結果
- 4.29 実行コマンド
- 4.30 編集内容
- 4.31 実行コマンド
- 4.32 実行コマンド
- 4.33 実行結果
- 4.34 実行コマンド
- 4.35 実行コマンド
- 4.36 実行コマンド
- 4.37 実行結果
- 4.38 実行コマンド
- 4.39 編集内容
- 4.40 実行コマンド
- 4.41 実行結果
- 4.42 実行コマンド
- 4.43 実行コマンド
- 4.44 実行コマンド
- 4.45 編集内容
- 4.46 実行コマンド
- 4.47 編集内容
- 4.48 実行コマンド
- 4.49 実行コマンド
- 4.50 編集内容
- 4.51 実行コマンド
- 4.52 実行コマンド
- 4.53 実行コマンド
- 4.54 実行結果
- 4.55 実行コマンド
はじめに
このページでは CentOS 7 系に Alfresco Content Services 6.0.x を WARファイルを使用してインストールする手順を説明します。
前提として、Alfresco SSL Generator を実行済みであるとします。
1.事前準備
事前に次のミドルウェアをインストールします。
インストール手順についてはリックソフトサポートドキュメントも参考にしてください。
1〜4 については公式ドキュメント、5 は Alfresco 社の GitHub リポジトリにも手順があります。
OpenJDK をインストールします。
PostgreSQL をインストールします。
LibreOffice をインストールします。
ImageMagick をインストールします。
Alfresco SSL Generator を実行します。
Alfresco Search Services をインストールします。
2.Tomcat のインストール
次のコマンドを実行して Tomcat の tar.gz ファイルをダウンロードします。(ここではアーカイブされたバージョンのファイルをダウンロードしています)
実行コマンド
# curl -LkvOf https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.50/bin/apache-tomcat-8.5.50.tar.gzダウンロードしたファイルが破損していないか確認します(Index of /dist/tomcat/tomcat-8)
実行コマンド
# sha512sum apache-tomcat-8.5.50.tar.gz実行結果
ffca86027d298ba107c7d01c779318c05b61ba48767cc5967ee6ce5a88271bb6ec8eed60708d45453f30eeedddcaedd1a369d6df1b49eea2cd14fa40832cfb90 apache-tomcat-8.5.50.tar.gzダウンロードした tar.gz ファイルを展開します。
実行コマンド
# tar zxf apache-tomcat-8.5.50.tar.gz3.Alfresco Content Services のインストール
alfresco-content-services-distribution-6.0.1.3.zip、alfresco-aos-module-distributionzip-1.2.2.zip をあらかじめサーバに配置します。
ログ格納用ディレクトリを作成します。
実行コマンド
# 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必要に応じて実行用ユーザを作成します。
実行コマンド
# useradd alfrescopostgres ユーザで psql コマンドを実行します
実行コマンド
# su - postgres
$ psqlデータベースを作成します
実行コマンド
postgres=# CREATE ROLE alfresco PASSWORD 'alfresco' createdb login;
postgres=# GRANT alfresco TO postgres;
postgres=# CREATE DATABASE alfresco OWNER alfresco template=template0 encoding='utf-8' lc_collate='C' lc_ctype='C';
postgres=# \q実行結果
CREATE DATABASEpostgres ユーザからログアウトします
実行コマンド
$ exit/opt 配下に新しくディレクトリを作成し、Tomcat のディレクトリを配置します
実行コマンド
# mkdir -p /opt/alfresco/content-services \
&& mv /root/apache-tomcat-8.5.50 /opt/alfresco/content-services/tomcatalfresco-content-services-distribution-6.0.1.3.zip ファイルを展開します
実行コマンド
# unzip alfresco-content-services-distribution-6.0.1.3.zip -d /opt/alfresco/content-services/alfresco-aos-module-distributionzip-1.2.2.zip ファイルを展開します
実行コマンド
# unzip /root/alfresco-aos-module-distributionzip-1.2.2.zip -d /opt/alfresco/content-services/amps/Alfresco PDF Renderer の tgz ファイルを展開します
実行コマンド
# cd /opt/alfresco/content-services/alfresco-pdf-renderer \
&& tar zxf alfresco-pdf-renderer-1.1-linux.tgzTomcat のディレクトリ配下に次のディレクトリを作成します
実行コマンド
# 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/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" ←追加
scheme="https" ←HTTPS接続の時は追加
secure="true" ←HTTPS接続の時は追加
maxHttpHeaderSize="32768" ←HTTPS接続の時は追加
redirectPort="8443" />
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol" ←追加
SSLEnabled="true" maxThreads="150" scheme="https" ←追加
keystoreFile="/opt/alfresco/content-services/alf_data/keystore/ssl.keystore" ←追加
keystorePass="alfresco" keystoreType="JCEKS" ←追加
secure="true" connectionTimeout="240000" ←追加
truststoreFile="/opt/alfresco/content-services/alf_data/keystore/ssl.truststore" ←追加
truststorePass="alfresco" truststoreType="JCEKS" ←追加
clientAuth="want" sslProtocol="TLS" /> ←追加
...catalina_pid 用に setenv.sh ファイルを作成する
実行コマンド
# vi /opt/alfresco/content-services/tomcat/bin/setenv.sh編集内容
CATALINA_PID="$CATALINA_BASE/content-services.pid"アドオン用のディレクトリをあらかじめ作成します
実行コマンド
# 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 shareweb-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 275031 11月 15 14:09 ROOT.war
-rw-rw-r-- 1 root root 762845 11月 15 14:10 _vti_bin.war
-rw-rw-r-- 1 root root 198601943 11月 15 14:35 alfresco.war
-rw-rw-r-- 1 root root 75575656 10月 25 16:29 share.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/tomcat/webapp 配下のフォルダを全て削除します
実行コマンド
# cd /opt/alfresco/content-services/tomcat/webapps/ \
&& rm -rf ROOT/ docs examples host-manager manager && ls -l
実行結果
total 234608
-rw-rw-r--. 1 root root 274635 6月 27 11:25 ROOT.war
-rw-rw-r--. 1 root root 166631479 6月 27 11:24 alfresco.war
-rw-rw-r--. 1 root root 73325486 6月 27 09:31 share.warweb-server フォルダを削除します
実行コマンド
# rm -rf /opt/alfresco/content-services/web-server/alfresco-global.properties ファイルを作成します
実行コマンド
# cp -a /opt/alfresco/content-services/tomcat/shared/classes/alfresco-global.properties.sample /opt/alfresco/content-services/tomcat/shared/classes/alfresco-global.properties \
&& ls -l /opt/alfresco/content-services/tomcat/shared/classes/実行結果
total 20
drwxr-xr-x. 4 root root 44 6月 27 11:25 alfresco
-rw-rw-r--. 1 root root 219 6月 27 11:25 alfresco-encrypted.properties
-rw-r--r--. 1 root root 6423 6月 26 08:05 alfresco-global.properties
-rw-r--r--. 1 root root 6423 6月 26 08:05 alfresco-global.properties.samplealfresco-global.properties ファイルを編集します
実行コマンド
# vi /opt/alfresco/content-services/tomcat/shared/classes/alfresco-global.properties編集内容
###############################
## Common Alfresco Properties #
###############################
#
# Sample custom content and index data location
#
dir.root=/opt/alfresco/content-services/alf_data ←コメント解除および編集
dir.keystore=${dir.root}/keystore ←コメント解除
#
# Sample database connection properties
#
db.username=alfresco ←コメント解除
db.password=alfresco ←コメント解除
db.name=alfresco ←追加
db.host=localhost ←追加
db.port=5432 ←追加
db.pool.max=275 ←追加
#
# External locations
#-------------
jodconverter.officeHome=/opt/libreoffice6.1 ←コメント解除および編集
jodconverter.portNumbers=8101 ←コメント解除
jodconverter.enabled=true ←コメント解除
img.root=/usr/lib64/ImageMagick-7.0.9 ←コメント解除および編集
img.exe=/usr/bin/convert ←追加
#
# Windows specific environment variables (should not be set on unix) for ImageMagick
#
img.coders=${img.root}/modules-Q16HDRI/coders ←Windows Server にインストールする場合にコメント解除および編集
imt.config=${img.root}/config-Q16HDRI ←Windows Server にインストールする場合にコメント解除および編集
(中略)
#
# 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.secureComms=https
#solr.port=8983
solr.port.ssl=8983
solr.host=localhost
solr.base.url=/solr
# ssl encryption
encryption.ssl.keystore.location=${dir.keystore}/ssl.keystore
encryption.ssl.keystore.type=JCEKS
encryption.ssl.keystore.keyMetaData.location=${dir.keystore}/ssl-keystore-passwords.properties
encryption.ssl.truststore.location=${dir.keystore}/ssl.truststore
encryption.ssl.truststore.type=JCEKS
encryption.ssl.truststore.keyMetaData.location=${dir.keystore}/ssl-truststore-passwords.properties
# secret key keystore configuration
encryption.keystore.location=${dir.keystore}/keystore
encryption.keystore.keyMetaData.location=${dir.keystore}/keystore-passwords.properties
encryption.keystore.type=JCEKS
### Alfresco PDF Renderer ###
alfresco-pdf-renderer.root=/opt/alfresco/content-services
alfresco-pdf-renderer.exe=${alfresco-pdf-renderer.root}/alfresco-pdf-renderer
alfresco-pdf-renderer.url=http://localhost:8090/
### 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
--------------------- 以下は商用モジュールが入っていない場合に出力されるエラーの抑制用 -----------------------------
transform.service.enabled=false
local.transform.service.enabled=false
legacy.transform.service.enabled=falseAlfresco SSL Generator で生成した証明書をコピーします
実行コマンド
# cp -p /root/work/alfresco-ssl-generator-master/ssl-tool/keystores/alfresco/* /opt/alfresco/content-services/alf_data/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: 1.2.2
- 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: 6.1.0
- 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 Content Services のサービスファイルを作成します
実行コマンド
# vi /etc/systemd/system/content-services.service
編集内容
[Unit]
Description=Alfresco Content Services
After=network.target postgresql-10.service
[Service]
Restart=no
Type=forking
User=alfresco
Group=alfresco
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 enabledAlfresco Content Services を起動します
実行コマンド
# systemctl start content-services && systemctl is-active content-services次の情報でログインします
| 項目名 | 設定値 |
|---|---|---|
1 | URL | http://<IPアドレス>:<ポート>/share |
2 | ユーザー名 | admin |
3 | パスワード | admin |
Alfresco Content Services を停止します
実行コマンド
# systemctl stop content-services && systemctl is-active content-servicesRepository 側のログの出力先を変更します
実行コマンド
# vi /opt/alfresco/content-services/tomcat/webapps/alfresco/WEB-INF/classes/log4j.properties編集内容
(省略)
log4j.appender.File=org.apache.log4j.DailyRollingFileAppender
log4j.appender.File.File=/var/log/alfresco/platform/alfresco.log ←編集
log4j.appender.File.Append=true
log4j.appender.File.DatePattern='.'yyyy-MM-dd
log4j.appender.File.layout=org.apache.log4j.PatternLayout
log4j.appender.File.layout.ConversionPattern=%d{yyyy-MM-dd} %d{ABSOLUTE} %-5p [%c] [%t] %m%n
(省略)Share 側のログの出力先を変更します
実行コマンド
# vi /opt/alfresco/content-services/tomcat/webapps/share/WEB-INF/classes/log4j.properties編集内容
(省略)
log4j.appender.File=org.apache.log4j.DailyRollingFileAppender
log4j.appender.File.File=/var/log/alfresco/share/share.log ←編集
log4j.appender.File.Append=true
log4j.appender.File.DatePattern='.'yyyy-MM-dd
log4j.appender.File.layout=org.apache.log4j.PatternLayout
log4j.appender.File.layout.ConversionPattern=%d{yyyy-MM-dd} %d{ABSOLUTE} %-5p [%c] [%t] %m%n
(省略)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 ←編集すでに出力されているログを、新しい格納先に配置します。
実行コマンド
# mv /opt/alfresco/content-services/tomcat/logs/* /var/log/alfresco/tomcat/TinyMCE language pack から必要な言語を選択してダウンロードし、その zip ファイルをあらかじめサーバに配置します。
tinymce_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
実行結果
0再度 Alfresco Content Services を起動します
実行コマンド
# systemctl start content-services && systemctl is-active content-services