Alfresco 是一個用 Java 編寫的開源 ECM 系統(企業內容管理),提供電子管理、協作和業務控制。

本指南將介紹如何在 RHEL/CentOS 7/6、Debian 8 和 Ubuntu 系統上安裝和配置 Alfresco 社區版,並將 Nginx 伺服器用作應用程式的前端網頁伺服器。
需求
至於最低系統需求,Alfresco 需要至少具有 4 GB 的 RAM 和 64 位元作業系統的機器。
步驟 1:安裝 Alfresco 社區版
1. 在進行 Alfresco 安裝之前,請確保您的機器已安裝 wget 工具,方法是以 root 權限或從 root 帳戶發出以下命令。
# yum install wget # apt-get install wget

2. 接下來,設定系統主機名稱,並確保本地解析指向您的伺服器 IP 位址,方法是發出以下命令:
# hostnamectl set-hostname server.alfresco.lan # echo “192.168.0.40 server.alfresco.lan” >> /etc/hosts

3. 通過發出以下命令從機器中刪除任何 MTA(在本例中為 Postfix 郵件伺服器):
# yum remove postfix # apt-get remove postfix

4. 安裝 Alfresco 軟體所需的以下依賴項,以便正常運行:
# yum install fontconfig libSM libICE libXrender libXext cups-libs # apt-get install libice6 libsm6 libxt6 libxrender1 libfontconfig1 libcups2

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

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安裝繼續…
---------------------------------------------------------------------------- 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安裝設置繼續..
---------------------------------------------------------------------------- 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

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 服務,請打開瀏覽器並使用以下 URL(根據需要替換 IP 地址或域名)。使用管理員用戶名和在安裝過程中配置的管理員密碼登錄。
http://IP-or-domain.tld:8080/share/


http://IP-or-domain.tld:8080/alfresco/

對於 WebDAV。
http://IP-or-domain.tld:8080/alfresco/webdav

對於 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; }

向下滾動,確保您通過在以下行的前面放置 # 來注釋第二個位置語句:
#location / { # }
13. 完成後,保存並關閉 Nginx 配置文件,通過發出以下命令重新啟動守護進程以反映更改:
# systemctl restart nginx.service
14. 為了訪問 Alfresco Web 介面,在您的機器上添加一條新的防火牆規則以打開端口 80,並導航到以下 URL。同時,確保在 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安全地通過Nginx代理訪問Alfresco Web界面,在/etc/nginx/ssl/
目錄上創建一個Nginx的自簽名證書,並根據下面的屏幕截圖填寫證書的自定義設置:
# mkdir /etc/nginx/ssl # cd /etc/nginx/ssl/ # openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout alfresco.key -out alfresco.crt

請注意證書通用名稱
要與您的域名主機名匹配。
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. }

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/

19.為了在整個系統中啟用Alfresco和Nginx守護程序,運行以下命令:
# systemctl enable nginx alfresco
就這樣!Alfresco通過CIFs協議與MS Office和LibreOffice集成,為用戶提供熟悉的工作流程。
Source:
https://www.tecmint.com/install-alfresco-community-edition-on-centos-debian-ubuntu/