כיצד להתקין Alfresco Community Edition ב-RHEL/CentOS 7/6 וב-Debian 8

אלפרסקו הוא מערכת ECM קוד פתוח (Enterprise Content Management) שנכתבה בשפת Java, המספקת ניהול אלקטרוני, שיתוף פעולה ושליטה עסקית.

Install Alfresco Community Edition in Linux

מדריך זה יכסה איך להתקין ולהגדיר את גרסת הקהילה של אלפרסקו על מערכות RHEL/CentOS 7/6, Debian 8 ו־Ubuntu עם שרת Nginx כשרת אינטרנט חזיתי עבור היישום.

דרישות

לגבי דרישות המערכת המינימליות, אלפרסקו דורשת מחשב עם לפחות 4 גיגה-בייט של RAM ומערכת הפעלה בגרסה 64 ביט.

שלב 1: התקנת גרסת הקהילה של אלפרסקו

1. לפני שממשיכים עם ההתקנה של אלפרסקו, וודאו שהכלי 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. התקינו את התלות הבאות הנדרשות על ידי תוכנת אלפרסקו כדי שהתוכנה תרוץ כהלכה:

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

5. לאחר מכן, עבור לדף המאגר של גרסת הקהילה של Alfresco המתארחת בפורטל sourceforge.net וצלצל את הגרסה הבינארית האחרונה (כלומר, alfresco-community-5.0.d-installer-linux-x64.bin) עבור Linux באמצעות כלי wget.

# 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 מופעלים, נתן את הפקודות הבאות כדי לפתוח את פתחי האש הבאים כדי לאפשר למארחים חיצוניים ברשת שלך להתחבר ליישום האינטרנט.

# 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, פתח דפדפן והשתמש בכתובות ה-URL הבאות (החלף את כתובת ה-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/ 

מודול Alfresco SharePoint עם Microsoft.

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

שלב 2: הגדר את Nginx כשרת אינטרנט חזיתי עבור Alfresco

10. כדי להתקין שרת Nginx במערכת, תוסיף תחילה את מאגרי ה־Epel ב־CentOS/RHEL על ידי הרצת הפקודה הבאה:

# yum install epel-release

11. לאחר שמאגרי ה־Epel נוספו למערכת, המשך עם התקנת שרת האינטרנט Nginx על ידי הרצת הפקודה הבאה:

# 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, הוסף כלל חומת אש חדש לפתיחת יציאה 80 במחשב שלך ונווט לכתובת ה-URL שבקישור. וודא גם שמדיניות ה־Selinux מושבתת במערכות RHEL/CentOS.

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

כדי לנטרל לחלוטין את מדיניות ה־Selinux במערכת, פתח את קובץ /etc/selinux/config ושנה את השורה SELINUX מ־enforcing ל־disabled.

15. כעת תוכל לגשת ל־Alfresco דרך Nginx.

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

15. במקרה שברצונך לבקר בממשק האינטרנט של Alfresco בצורה מאובטחת דרך פרוקסי Nginx עם SSL, צור תעודה עצמית ל־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

שים לב ל־Certificate Common Name להתאים לשם המארח שלך.

17. לאחר מכן, פתח את קובץ התצורה של Nginx לעריכה והוסף את הבלוק הבא לפני הסוגריים הסופיים (הסמל }).

# vi /etc/nginx/nginx.conf

קטע בלוק SSL של Nginx:

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

והורה לדפדפן לכתובת ה־URL של הדומיין שלך באמצעות פרוטוקול HTTPS.

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

19. כדי לאפשר את דמוני Alfresco ו־Nginx בכל המערכת, הרץ את הפקודה הבאה:

# systemctl enable nginx alfresco

זה הכל! Alfresco מציעה שילוב עם MS Office ו־LibreOffice דרך פרוטוקול CIFs שמספק תהליך עבודה מוכר למשתמשים.

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