はじめに

このページでは Alfresco Content Services 6.1.x のインストール方法を説明します。

前提として、Alfresco SSL Generator を実行済みであるとします。

1.事前準備

以下のミドルウェアをインストールします。

インストール手順についてはリックソフトサポートドキュメントも参考にしてください。

1〜5 については公式ドキュメント、6 は Alfresco 社の GitHub リポジトリにも手順があります。

  1. OpenJDK をインストールします。
  2. PostgreSQL をインストールします。
  3. LibreOffice をインストールします。
  4. ImageMagick をインストールします。
  5. ActiveMQ をインストールします。
  6. Alfresco SSL Generator を実行します。
  7. 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.gz

3.Alfresco Content Services のインストール


alfresco-content-services-distribution-6.1.1.1.zip、alfresco-aos-module-distributionzip-1.3.0.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 alfresco

postgres ユーザで 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 DATABASE

postgres ユーザからログアウトします

$ exit

/opt 配下に新しくディレクトリを作成し、Tomcat のディレクトリを配置します

# mkdir -p /opt/alfresco/content-services \
&& mv /root/apache-tomcat-8.5.50 /opt/alfresco/content-services/tomcat

alfresco-content-services-distribution-6.1.1.1.zip ファイルを展開します

# unzip alfresco-content-services-distribution-6.1.1.1.zip -d /opt/alfresco/content-services/

alfresco-aos-module-distributionzip-1.3.0.zip ファイルを展開します

# unzip /root/alfresco-aos-module-distributionzip-1.3.0.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.tgz

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

/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 share

web-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


コンテンツを移動します

# 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.war

web-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.sample

alfresco-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 ←コメント解除


(中略)


------------------------------------- 以下を追加 -------------------------------------------

messaging.broker.url=failover:(tcp://localhost:61616)?timeout=3000

### 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=false

Alfresco 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


0

amp を適用するスクリプトに実行権限を付与します

# chmod u+x /opt/alfresco/content-services/bin/apply_amps.sh

alfresco 実行用ユーザにスイッチします

# 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.3.0
   -    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.1.1
   -    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-11.service activemq.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.target

Alfresco 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-services

次の情報でログインします


項目名設定値
1URLhttp://<IPアドレス>:<ポート>/share
2ユーザー名admin
3パスワードadmin

Alfresco Content Services を停止します

# systemctl stop content-services && systemctl is-active content-services

Repository 側のログの出力先を変更します

# 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.properties

catalina.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