如何在RHEL/CentOS 7/6和Debian 8上安装Alfresco Community Edition

Alfresco 是一个用 Java 编写的开源 ECM 系统(企业内容管理),提供电子管理、协作和业务控制。

Install Alfresco Community Edition in Linux

本指南将介绍如何在 RHEL/CentOS 7/6Debian 8Ubuntu 系统上安装和配置 Alfresco Community Edition,并将 Nginx 服务器作为应用程序的前端 Web 服务器。

要求

至于最低系统要求,Alfresco 需要至少 4 GB RAM 和 64 位操作系统的计算机。

第一步:安装 Alfresco Community Edition

1. 在继续 Alfresco 安装之前,请确保您的计算机上安装了 wget 实用程序,可以通过以下命令以 root 权限或从 root 帐户发出来确认。

# yum install wget
# apt-get install wget
Install Wget in Linux

2. 接下来,设置您的系统主机名,并确保本地解析指向您的服务器 IP 地址,可以通过以下命令来确认:

# hostnamectl set-hostname server.alfresco.lan
# echo “192.168.0.40 server.alfresco.lan” >> /etc/hosts
Set Hostname in Linux

3. 通过以下命令删除计算机上的任何 MTA(在本例中为 Postfix 邮件服务器):

# yum remove postfix
# apt-get remove postfix
Remove Postfix in Linux

4. 安装 Alfresco 软件运行所需的以下依赖项,以便正常运行:

# yum install fontconfig libSM libICE libXrender libXext cups-libs
# apt-get install libice6 libsm6 libxt6 libxrender1 libfontconfig1 libcups2
Install Alfresco Dependencies

5. 接下来,转到托管在sourceforge.net门户上的Alfresco社区版存储库页面,并使用wget实用程序获取最新的Linux二进制版本(即alfresco-community-5.0.d-installer-linux-x64.bin)。

# wget http://nchc.dl.sourceforge.net/project/alfresco/Alfresco%205.0.d%20Community/alfresco-community-5.0.d-installer-linux-x64.bin

6. 二进制文件下载完成后,发出以下命令以授予文件执行权限并运行alfresco安装程序。

# chmod +x alfresco-community-5.0.d-installer-linux-x64.bin
# ./alfresco-community-5.0.d-installer-linux-x64.bin

7. 安装过程开始后,选择语言,并使用下面的安装向导作为配置Alfresco的指南继续安装过程:

[root@server ~]# ./alfresco-community-5.0.d-installer-linux-x64.bin 
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] : 1
----------------------------------------------------------------------------
Welcome to the Alfresco Community Setup Wizard.

----------------------------------------------------------------------------
Installation Type

[1] Easy - Installs servers with the default configuration
[2] Advanced - Configures server ports and service properties.: Also 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] :y

PostgreSQL [Y/n] :y

Alfresco : Y (Cannot be edited)

Solr1 [y/N] : n

Solr4 [Y/n] :y

SharePoint [Y/n] :y

Web Quick Start [y/N] : y

Google Docs Integration [Y/n] :y

LibreOffice [Y/n] :y

Is the selection above correct? [Y/n]: y
Installation of Alfresco Community Edition

Alfresco安装向导继续…

----------------------------------------------------------------------------
Installation Folder

Please choose a folder to install Alfresco Community

Select a folder [/opt/alfresco-5.0.d]: [Press Enter key]

----------------------------------------------------------------------------
Database Server Parameters

Please enter the port of your database.

Database Server port [5432]: [Press Enter key]

----------------------------------------------------------------------------
Tomcat Port Configuration

Please enter the Tomcat configuration parameters you wish to use.

Web Server domain: [127.0.0.1]: 192.168.0.15 

Tomcat Server Port: [8080]: [Press Enter key

Tomcat Shutdown Port: [8005]: [Press Enter key

Tomcat SSL Port [8443]: [Press Enter key

Tomcat AJP Port: [8009]: [Press Enter key

----------------------------------------------------------------------------
Alfresco FTP Port

Please choose a port number to use for the integrated Alfresco FTP server.

Port: [21]: [Press Enter key
Alfresco Installation Wizard

Alfresco安装继续…

----------------------------------------------------------------------------
Admin Password

Please give a password to use for the Alfresco administrator account.

Admin Password: :[Enter a strong password for Admin user]
Repeat Password: :[Repeat the password for Admin User]
----------------------------------------------------------------------------
Alfresco SharePoint Port

Please choose a port number for the SharePoint protocol.

Port: [7070]: [Press Enter key]

----------------------------------------------------------------------------
Install as a service

You can optionally register Alfresco Community as a service. This way it will 
automatically be started every time the machine is started.

Install Alfresco Community as a service? [Y/n]: y


----------------------------------------------------------------------------
LibreOffice Server Port

Please enter the port that the Libreoffice Server will listen to by default.

LibreOffice Server Port [8100]: [Press Enter key]

----------------------------------------------------------------------------
Alfresco Installation Continues

Alfresco安装设置继续..

----------------------------------------------------------------------------
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]: n

Launch Alfresco Community Share [Y/n]: y

waiting for server to start....[root@server ~]#  done
server started
/opt/alfresco-5.0.d/postgresql/scripts/ctl.sh : postgresql  started at port 5432
Using CATALINA_BASE:   /opt/alfresco-5.0.d/tomcat
Using CATALINA_HOME:   /opt/alfresco-5.0.d/tomcat
Using CATALINA_TMPDIR: /opt/alfresco-5.0.d/tomcat/temp
Using JRE_HOME:        /opt/alfresco-5.0.d/java
Using CLASSPATH:       /opt/alfresco-5.0.d/tomcat/bin/bootstrap.jar:/opt/alfresco-5.0.d/tomcat/bin/tomcat-juli.jar
Using CATALINA_PID:    /opt/alfresco-5.0.d/tomcat/temp/catalina.pid
Tomcat started.
/opt/alfresco-5.0.d/tomcat/scripts/ctl.sh : tomcat started
Alfresco Installation Setup

8. 安装过程完成并启动Alfresco服务后,发出以下命令以打开以下防火墙端口,以允许您网络中的外部主机连接到Web应用程序。

# firewall-cmd --add-port=8080/tcp -permanent
# firewall-cmd --add-port=8443/tcp -permanent
# firewall-cmd --add-port=7070/tcp -permanent
# firewall-cmd --reload

如果您需要添加其他防火墙规则以打开端口以访问自定义Alfresco服务,请使用ss命令获取运行在您的计算机上的所有服务的列表。

# ss -tulpn

9. 要访问 Alfresco Web 服务,请打开浏览器并使用以下网址(根据需要替换 IP 地址或域名)。使用管理员用户登录,并使用安装过程中配置的管理员密码。

http://IP-or-domain.tld:8080/share/ 
Alfresco Community Login
Alfresco Administrator Dashboard
http://IP-or-domain.tld:8080/alfresco/ 
Alfresco Documentation

对于 WebDAV。

http://IP-or-domain.tld:8080/alfresco/webdav 
Alfresco WebDav Directory Listing

对于 HTTPS,请接受安全异常。

https://IP-or-domain.tld:8443/share/ 

使用 Microsoft 的 Alfresco SharePoint 模块。

http://IP-or-domain.tld:7070/

第 2 步:将 Nginx 配置为 Alfresco 的前端 Web 服务器

10. 为了在系统上安装 Nginx 服务器,首先通过以下命令添加 CentOS/RHEL 上的 Epel 仓库

# yum install epel-release

11. 在将 Epel 仓库添加到系统后,通过以下命令继续进行 Nginx Web 服务器安装:

# yum install nginx       [On RHEL/CentOS Systems]
# apt-get install nginx   [On Debian/Ubuntu Systems]  

12. 在下一步中,使用文本编辑器打开 Nginx 配置文件 /etc/nginx/nginx.conf 并进行以下更改:

location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
Configure Nginx for Alfresco

转到下面,确保通过在以下行前面加上 # 注释第二个位置语句:

#location / {
#        }

13. 完成后,保存并关闭 Nginx 配置文件,并通过以下命令重新启动守护进程以反映更改:

# systemctl restart nginx.service

14. 为了访问 Alfresco Web 界面,在您的计算机上添加一个新的防火墙规则以打开端口 80,并导航到以下网址。还要确保在 RHEL/CentOS 系统上禁用 Selinux 策略。

# firewall-cmd --add-service=http -permanent
# firewall-cmd --reload
# setenforce 0

要完全禁用系统上的Selinux策略,请打开/etc/selinux/config文件,并将行SELINUX从enforcing设置为disabled

15.现在您可以通过Nginx访问Alfresco。

 http://IP-or-domain.tld/share/ 
 http://IP-or-domain.tld/alfresco/
 http://IP-or-domain.tld/alfresco/webdav 

15.如果您想要通过SSL安全地访问Alfresco Web界面,请通过Nginx代理创建一个自签名证书在/etc/nginx/ssl/目录中,并根据下面的截图填写证书的自定义设置:

# mkdir /etc/nginx/ssl
# cd /etc/nginx/ssl/
# openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout alfresco.key -out alfresco.crt
Create SSL Certificate for Alfresco

注意证书通用名称要与您的域名主机名匹配。

17.接下来,打开Nginx配置文件进行编辑,并在最后一个闭合花括号(}符号)之前添加以下块。

# vi /etc/nginx/nginx.conf

Nginx SSL块摘录:

server {
    listen 443;
    server_name _;

    ssl_certificate           /etc/nginx/ssl/alfresco.crt;
    ssl_certificate_key       /etc/nginx/ssl/alfresco.key;

    ssl on;
    ssl_session_cache  builtin:1000  shared:SSL:10m;
    ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
    ssl_prefer_server_ciphers on;

    access_log            /var/log/nginx/ssl.access.log;

      location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
## This is the last curly bracket before editing the file. 
  }
Nginx SSL Configuration for Alfresco

18.最后,重新启动Nginx守护程序以应用更改,为443端口添加新的防火墙规则。

# systemctl restart nginx
# firewall-cmd -add-service=https --permanent
# firewall-cmd --reload

并指示浏览器使用HTTPS协议访问您的域名URL。

https://IP_or_domain.tld/share/
https://IP_or_domain.tld/alfresco/
Configure Alfresco as Domain

19.为了在整个系统范围内启用Alfresco和Nginx守护程序,请运行以下命令:

# systemctl enable nginx alfresco

就这样!Alfresco通过CIFs协议与MS OfficeLibreOffice集成,为用户提供熟悉的工作流程。

Source:
https://www.tecmint.com/install-alfresco-community-edition-on-centos-debian-ubuntu/