如何使用向导部署Alfresco?

Alfresco

1 基础知识

1.1 简介

Alfresco是一个免费、自由的企业内容系统,英文简称ECMS。

1.2 提供的功能

– 日常文档管理
– 协同工作
– 工作记录管理
– 知识管理
– 网络内容管理
– 图片管理等

1.3 特点

– 文件兼容性,同时兼容Microsoft Windows和类unix操作系统
– 开箱即用,以WEB门户框架来管理和标准化门户内容系统
– 跨平台,程序由Java技术开发

1.4 使用的优点

– 基于开源的Lucene的文档搜索功能
– 基于Openoffice提供多种文档格式转换
– 基于目录树管理文档
– 支持多国语言
– 用户使用简单(便于企业中推广)

1.5 Alfreeco的应用场景

– 作为内容存储库
– 作为WEB门户框架

1.6 部署环境

– Tomcat
– MySQL
– Linux

2 实操部分

2.1 系统环境配置

2.1.1 系统环境信息

IP Address = 10.168.0.50
OS = CentOS 7.3 x86_64

2.1.2 安装常用的工具

yum install -y wget vim unzip

2.1.3 时间相关配置

2.1.3.1 安装ntp客户端

yum install -y chrony

2.1.3.2 启动NTP客户端

systemctl start chronyd
systemctl enable chronyd

2.1.4 配置SELinux

setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

2.1.3.3 配置时区

timedatectl set-timezone Asia/Shanghai

2.2 安装MySQL

2.2.1 防火墙配置

firewall-cmd --permanent --add-service mysql
firewall-cmd --reload
firewall-cmd --list-all

2.2.2 配置安装源

yum install -y http://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql57-community-release-el7-10.noarch.rpm

注:其他版本请参阅以下链接
http://repo.mysql.com/yum/

2.2.3 配置安装包

yum install -y mysql-community-server mysql-community-devel mysql-community-client

2.2.4 启动数据库

systemctl start mysqld
systemctl enable mysqld

2.2.5 初始化数据库

获取临时密码:

cat /var/log/mysqld.log | grep 'A temporary password'

显示如下:

2017-04-22T07:10:18.747550Z 1 [Note] A temporary password is generated for root@localhost: ufqLq&R6tgl%

初始化数据库:

mysql_secure_installation

向导如下:

[...]
Enter password for user root:ufqLq&R6tgl%
[...]
New password:******
Re-enter new password:******
[...]
Would you like to setup VALIDATE PASSWORD plugin?
Press y|Y for Yes, any other key for No: n
[...]
Change the password for root ? ((Press y|Y for Yes, any other key for No) : n
[...]
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
[...]
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
[...]
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y                                                                
[...]
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
[...]

2.2.6 准备应用的数据库

mysql -uroot -p
create database alfresco character set utf8;
grant all privileges on alfresco.* to 'alfresco'@'localhost' identified by 'alfrescopwd';
grant all privileges on alfresco.* to 'alfresco'@'127.0.0.1' identified by 'alfrescopwd';
flush privileges;

2.3 安装JDK

2.3.1 准备安装环境

2.3.1.1 下载JDK二进制安装包

cd ~
wget http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.tar.gz?AuthParam=1519347929_57bfb44c70a559c46d9d010f18391706 -O jdk-8u161-linux-x64.tar.gz

注:如果不能下载,是以上认证信息失效,请重新获通过JDK下载页面获取,
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

2.3.1.2 部署Java目录

mkdir /usr/java
tar -xf jdk-8u161-linux-x64.tar.gz
mv jdk1.8.0_161/ /usr/java/

2.3.2 配置安装包

2.3.2.1 配置环境变量

vim /etc/profile.d/jdk.sh

输入如下配置:

export JAVA_HOME=/usr/java/jdk1.8.0_161
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

导入环境变量:

source /etc/profile

2.3.2.2 测试JDK安装

java -version

显示信息如下:

java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b01, mixed mode)

2.4 安装Alfresco

2.4.1 防火墙配置

firewall-cmd --permanent --add-port=8080/tcp
firewall-cmd --permanent --add-port=8443/tcp
firewall-cmd --reload
firewall-cmd --list-all

2.4.2 创建运行用户

groupadd  -g 888 alfresco
useradd -u 888 -g 888 -d /usr/alfresco  -s /bin/bash alfresco

2.4.3 下载软件包

su - alfresco
cd ~
wget http://d1juwce2y308l6.cloudfront.net/release/community/201707-build-00028/alfresco-community-installer-201707-linux-x64.bin?Expires=1521785940&Signature=nHqSh~9TJkUEmHFOafub2SYqcS7hsQb6uGVh90qCuocj3Bd99S0x1DTGfCddvWXVyFJPDAAsj5tbyDQYrKoe1PebtIyZquxlo8aTVKceBJzl01ZPoaL2c9PQ85iT3cOKj1Z3uFtQemIYLFNA24xdu~MfNaqR4GcGhPydTSkCAehDUdjWSbCyDBjjtqaPD2saTto3QhblyG2TDva0l2evgZDFY~flWJc9u85sI2w7UGtmWV~0XzIsqtX16uixtBICzCwjtHw0Asd~g~XZYGE7mGggdWlOcuFlcVAubympouX3pOl7OD3Jw1lokfag0Dj~A4T-rVbjb7Bthg4C6pncYQ__&Key-Pair-Id=APKAIWUXSJDXLMSTSCYA -O alfresco-community-installer-201707-linux-x64.bin

注:其他版本请从以下链接下载,
https://sourceforge.net/projects/alfresco/files

2.4.4 配置运行权限

chmod u+x alfresco-community-installer-201707-linux-x64.bin

2.4.5 运行安装向导

./alfresco-community-installer-201707-linux-x64.bin

向导如下:

----------------------------------------------------------------------------
[...]
Do you want to continue with the installation? [y/N]:y

Language Selection

Please select the installation language
[1] English - English
[2] French - Français
[3] Spanish - Español
[4] Italian - Italiano
[5] German - Deutsch
[6] Japanese - 日本語
[7] Dutch - Nederlands
[8] Russian - Русский
[9] Simplified Chinese - 简体中文
[10] Norwegian - Norsk bokmål
[11] Brazilian Portuguese - Português Brasileiro
Please choose an option [1] :
[...]
----------------------------------------------------------------------------
Installation Type
[1] Easy - Install using the default configuration.
[2] Advanced - Configure server ports and service properties.: Choose optional components to install.
Please choose an option [1] : 2

----------------------------------------------------------------------------
Select the components you want to install; clear the components you do not want
to install. Click Next when you are ready to continue.
Java [Y/n] :n
PostgreSQL [Y/n] :n
LibreOffice [Y/n] :y
Alfresco Community : Y (Cannot be edited)
Solr1 [y/N] :n
Solr4 [Y/n] :y
Alfresco Office Services [Y/n] :y
Web Quick Start [y/N] :y
Google Docs Integration [Y/n] :y
Is the selection above correct? [Y/n]:y
----------------------------------------------------------------------------
[...]
Select a folder: [/usr/alfresco/alfresco-community]:
----------------------------------------------------------------------------
Database Configuration
JDBC URL: [jdbc:postgresql://localhost/alfresco]:
JDBC Driver: [org.postgresql.Driver]:
Database name: [alfresco]:
Username: []:
Password: :
Verify: :
----------------------------------------------------------------------------
Tomcat Port Configuration
Enter your Tomcat configuration parameters.
Web Server Domain: [127.0.0.1]:10.168.0.50
Tomcat Server Port: [8080]:
Tomcat Shutdown Port: [8005]:
Tomcat SSL Port: [8443]:
Tomcat AJP Port: [8009]:
----------------------------------------------------------------------------
LibreOffice Server Port
Enter the port that the LibreOffice Server will listen to.
LibreOffice Server Port: [8100]:
----------------------------------------------------------------------------
FTP Port
Choose a port number for the integrated FTP server.
Port: [2121]:
----------------------------------------------------------------------------
Admin Password
Specify a password for the Alfresco Content Services administrator account.
Admin Password: :
Repeat Password: :
----------------------------------------------------------------------------
Setup is now ready to begin installing Alfresco Community on your computer.
Do you want to continue? [Y/n]:y
----------------------------------------------------------------------------
Please wait while Setup installs Alfresco Community on your computer.

Installing
0% ______________ 50% ______________ 100%
#########################################
----------------------------------------------------------------------------
Setup has finished installing Alfresco Community on your computer.

View Readme File [Y/n]: y

Launch Alfresco Community [Y/n]: n

README
Alfresco Community (Build: 201707)
===============================

Contains:
        - Alfresco Platform:    5.2.g
        - Alfresco Share:               5.2.f

For users of Alfresco Community Edition, more information on this release is
available at https://community.alfresco.com/community/ecm

Press [Enter] to continue:

2.4.6 部署JDBC驱动

cd ~
wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.45.tar.gz
tar -xf mysql-connector-java-5.1.45.tar.gz
cp mysql-connector-java-5.1.45/mysql-connector-java-5.1.45-bin.jar alfresco-community/tomcat/lib/

注:如果无法下载请从以下链接下载,
https://dev.mysql.com/downloads/connector/j/

2.4.7 修改JDBC连接

vim /usr/alfresco/alfresco-community/tomcat/shared/classes/alfresco-global.properties

修改如下配置:

### database connection properties ###
db.driver=org.gjt.mm.mysql.Driver
db.username=alfresco
db.password=alfrescopwd
db.name=alfresco
db.url=jdbc:mysql://localhost:3306/alfresco?useUnicode=yes&characterEncoding=UTF-8&useSSL=false
db.pool.max=275
db.pool.validate.query=SELECT 1

注:参数“useSSL=false”请根据数据库的实际需要配置。

2.4.8 部署服务控制脚本

vim /etc/systemd/system/alfresco.service

加入如下配置:

Description=alfresco service
After=syslog.target network.target mysqld.service

[Service]
Type=forking
ExecStart=/sbin/runuser -l alfresco -c '/usr/alfresco/alfresco-community/tomcat/scripts/ctl.sh start'
PIDFile=/usr/alfresco/alfresco-community/tomcat/temp/catalina.pid
ExecStop=/sbin/runuser -l alfresco -c '/usr/alfresco/alfresco-community/tomcat/scripts/ctl.sh stop'

[Install]
WantedBy=multi-user.target

注:是否要等待mysqld服务启动请根据实际情况决定
重载服务脚本:

systemctl daemon-reload

测试部署的脚本并配置自启动:

systemctl start alfresco.service
systemctl status alfresco.service
systemctl stop alfresco.service
systemctl enable alfresco.service

2.5 排错与测试

2.5.1 排错相关日志

tail -f /usr/alfresco/alfresco-community/tomcat/logs/catalina.out

2.5.2 文件管理登录测试

http://10.168.0.50:8080/share
https://10.168.0.50:443/share

注:
– 默认账号:admin
– 密码:向导配置的密码
– 如果登录异常,请清理浏览器缓存再试

2.5.3 其他登录测试

http://10.168.0.50:8080/alfresco
https://10.168.0.50:8080/alfresco

参阅文档
=========================
安装支持文档
https://www.alfresco.com/services/subscription/supported-platforms
https://docs.alfresco.com/5.2/concepts/supported-platforms-ACS.html

安装范例
——————–
http://www.dark-hamster.com/software/installing-alfresco-with-mysql/
https://www.tecmint.com/install-alfresco-community-edition-on-centos-debian-ubuntu/

数据库连接:
——————–
https://docs.alfresco.com/4.0/tasks/mysql-config.html

理论部分参阅文档
———————
https://baike.baidu.com/item/alfresco/554341?fr=aladdin

没有评论

发表回复

Alfresco
如何手动部署Alfresco?

1 基础知识 1.1 简介 Alfresco是一个免费、自由的企业内容系统,英文简称ECMS。 1. …