ค้นหาเว็บไซต์

วิธีติดตั้ง Alfresco Community Edition บน RHEL/CentOS 7/6 และ Debian 8


Alfresco เป็นระบบ ECM แบบโอเพ่นซอร์ส (การจัดการเนื้อหาองค์กร) ที่เขียนด้วยภาษา Java ซึ่งให้การจัดการทางอิเล็กทรอนิกส์ การทำงานร่วมกัน และการควบคุมธุรกิจ

คู่มือนี้จะครอบคลุมวิธีการติดตั้งและกำหนดค่า Alfresco Community Edition บน RHEL/CentOS 7/6, Debian 8 และ Ubuntu ระบบที่มีเซิร์ฟเวอร์ Nginx เป็นเว็บเซิร์ฟเวอร์ส่วนหน้าสำหรับแอปพลิเคชัน

ความต้องการ

สำหรับข้อกำหนดขั้นต่ำของระบบ Alfresco ต้องการเครื่องที่มี RAM อย่างน้อย 4 GB และระบบปฏิบัติการ 64 บิต

ขั้นตอนที่ 1: ติดตั้ง Alfresco Community Edition

1. ก่อนดำเนินการติดตั้ง Alfresco อันดับแรกตรวจสอบให้แน่ใจว่าได้ติดตั้งยูทิลิตี้ wget บนเครื่องของคุณแล้ว โดยใช้คำสั่งด้านล่างพร้อมสิทธิ์รูทหรือจากบัญชีรูท

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 Mail) โดยออกคำสั่งด้านล่าง:

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. จากนั้น ไปที่หน้าพื้นที่เก็บข้อมูล Alfresco Community Edition ที่โฮสต์บนพอร์ทัล 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. หลังจากที่ดาวน์โหลดไฟล์ไบนารีเสร็จสิ้น ให้ออกคำสั่งต่อไปนี้เพื่อให้สิทธิ์ในการดำเนินการสำหรับไฟล์และรันโปรแกรมติดตั้งกลางแจ้ง

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 ให้ออกคำสั่งด้านล่างเพื่อเปิดพอร์ตไฟร์วอลล์ต่อไปนี้เพื่ออนุญาตให้โฮสต์ภายนอกในเครือข่ายของคุณเชื่อมต่อกับเว็บแอปพลิเคชัน


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/ 

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

สำหรับ WebDAV

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

สำหรับ HTTPS ให้ยอมรับข้อยกเว้นด้านความปลอดภัย

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

โมดูล Alfresco SharePoint กับ Microsoft

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

ขั้นตอนที่ 2: กำหนดค่า Nginx เป็นเว็บเซิร์ฟเวอร์ส่วนหน้าสำหรับ Alfresco

10. ในการติดตั้งเซิร์ฟเวอร์ Nginx บนระบบ ก่อนอื่นให้เพิ่ม Epel Repositories บน CentOS/RHEL โดยใช้คำสั่งด้านล่าง:

yum install epel-release

11. หลังจากเพิ่ม Epel repos เข้าสู่ระบบแล้ว ให้ดำเนินการติดตั้งเว็บเซิร์ฟเวอร์ 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;
    }

ไปที่ด้านล่างและให้แน่ใจว่าคุณแสดงความคิดเห็นในคำชี้แจงตำแหน่งที่สองโดยการวาง # ไว้หน้าบรรทัดต่อไปนี้:

#location / {
       }

13. หลังจากเสร็จแล้ว ให้บันทึกและปิดไฟล์การกำหนดค่า Nginx และรีสตาร์ท daemon เพื่อให้สอดคล้องกับการเปลี่ยนแปลงโดยออกคำสั่งต่อไปนี้:

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

โปรดใส่ใจกับ Certificate Common Name เพื่อให้ตรงกับชื่อโฮสต์ของโดเมนของคุณ

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 daemon เพื่อใช้การเปลี่ยนแปลง เพิ่มกฎไฟร์วอลล์ใหม่สำหรับพอร์ต 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/

19. เพื่อเปิดใช้งาน Alfresco และ Nginx daemons ทั้งระบบ ให้รันคำสั่งด้านล่าง:

systemctl enable nginx alfresco

นั่นคือทั้งหมด! Alfresco นำเสนอการบูรณาการกับ MS Office และ LibreOffice ผ่านโปรโตคอล CIF ที่ให้ขั้นตอนการทำงานที่คุ้นเคยสำหรับผู้ใช้