Cách cài đặt Pydio trên Debian 11

theanh

Administrator
Nhân viên
Pydio là ứng dụng chia sẻ tệp miễn phí, mã nguồn mở và dựa trên đám mây. Ứng dụng này được viết bằng ngôn ngữ Golang và được sử dụng để chia sẻ tệp với máy khách. Ứng dụng này cho phép bạn chia sẻ và truy cập nhiều tài liệu khác nhau như tệp, hình ảnh và video từ bất kỳ đâu bằng ứng dụng di động, phần mềm máy tính để bàn hoặc trình duyệt web. Ứng dụng này có máy khách gốc cho Linux, Windows và macOS, và máy khách di động cho Android và iOS.

Trong hướng dẫn này, tôi sẽ chỉ cho bạn cách cài đặt ứng dụng Pydio trên Debian 11.

Điều kiện tiên quyết​

  • Máy chủ chạy Debian 11.
  • Mật khẩu gốc được định cấu hình trên máy chủ.

Cài đặt và định cấu hình MariaDB​

Pydio sử dụng MariaDB làm cơ sở dữ liệu phụ trợ, vì vậy bạn phải cài đặt máy chủ cơ sở dữ liệu MariaDB trên máy chủ của mình. Bạn có thể cài đặt bằng cách chạy lệnh sau:
Mã:
dnf install mariadb-server -y
Sau khi MariaDB được cài đặt, hãy bảo mật cài đặt MariaDB bằng lệnh sau:
Mã:
mysql_secure_installation
Tập lệnh này sẽ đặt mật khẩu gốc, xóa người dùng ẩn danh, không cho phép đăng nhập gốc từ xa và xóa cơ sở dữ liệu thử nghiệm như được hiển thị bên dưới:
Mã:
Set root password? [Y/n] n
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
Sau khi MariaDB được bảo mật, hãy đăng nhập vào MariaDB shell:
Mã:
mysql -u root -p
Sau khi đăng nhập, hãy tạo cơ sở dữ liệu và người dùng bằng lệnh sau:
Mã:
CREATE DATABASE pydiodb;
CREATE USER 'pydiodb'@'localhost' IDENTIFIED BY 'password';
Tiếp theo, cấp tất cả các quyền cho Pydio bằng lệnh sau lệnh:
Mã:
GRANT ALL PRIVILEGES ON pydiodb.* to 'pydiouser'@'localhost';
Tiếp theo, xóa các đặc quyền và thoát khỏi shell MariaDB bằng lệnh sau:
Mã:
FLUSH PRIVILEGES;
EXIT;

Cài đặt Pydio Cells​

Theo mặc định, gói Pydio không được bao gồm trong kho lưu trữ Debian 11. Vì vậy, bạn sẽ cần tải xuống từ trang web chính thức của họ.

Bạn có thể tải xuống phiên bản mới nhất của Pydio cells bằng lệnh sau:
Mã:
distribId=cells wget -O /usr/bin/cells https://download.pydio.com/latest/${distribId}/release/{latest}/linux-amd64/${distribId}
Sau khi tải xuống hoàn tất, hãy đặt quyền thực thi cho tệp đã tải xuống và liên kết tệp đó với cổng HTTP bằng lệnh sau:
Mã:
chmod +x /usr/bin/cells
setcap 'cap_net_bind_service=+ep' /usr/bin/cells
Tiếp theo, hãy xác minh phiên bản Pydio cells bằng lệnh sau lệnh:
Mã:
cells version
Bạn sẽ nhận được kết quả đầu ra sau:
Mã:
Warning: no private IP detected for binding broker. Will bind to 209.23.9.181, which may give public access to the broker.
Pydio Cells Home Edition Version:	3.0.6 Built:	22 Mar 22 06:06 +0su - pydio
cells configure000 Git commit:	2165523347d2b9860d9c86236b7a518456d9cef3 OS/Arch:	linux/amd64 Go version:	go1.15.14

Cấu hình Pydio Cells​

Tiếp theo, bạn sẽ cần cấu hình Pydio Cells. Bạn có thể cấu hình nó bằng lệnh sau:
Mã:
cells configure
Bạn sẽ được yêu cầu chọn giữa chế độ cài đặt dựa trên trình duyệt và chế độ cài đặt dòng lệnh.
Mã:
Welcome to Pydio Cells Home Edition installation
Pydio Cells Home Edition (v3.0.3) will be configured to run on this machine.
Make sure to prepare access and credentials to a MySQL 5.6+ (or MariaDB equivalent) server.
Pick your installation mode when you are ready.
Chọn cài đặt dựa trên trình duyệt và nhấn phím Enter. Sau khi Pydio Cells được cấu hình, bạn sẽ nhận được kết quả sau:
Mã:
Use the arrow keys to navigate: ↓ ↑ → ←
? Installation mode: ? Browser-based (requires a browser access) Command line (performed in this terminal)
? Browser-based (requires a browser access)
2022-04-02T11:16:18.544Z INFO pydio.gateway.rest Started
2022-04-02T11:16:18.685Z	INFO	pydio.rest.install	Started
2022-04-02T11:16:22.010Z	INFO
Installation Server is starting...
Listening to: 0.0.0.0:8080
2022-04-02T11:16:22.366Z	INFO	? Created a new local CA at "/root/.config/pydio/cells/certs/rootCA.pem" ????
2022-04-02T11:16:22.366Z	INFO	? Created a new certificate valid for the following names ???? - "127.0.0.1" - "209.23.9.181" - "localhost"
2022-04-02T11:16:22.366Z	INFO	? The certificate is at "/root/.config/pydio/cells/certs/e6de382e6f121a9072d77b25ba622a36.pem"
2022-04-02T11:16:22.366Z	INFO and the key at "/root/.config/pydio/cells/certs/e6de382e6f121a9072d77b25ba622a36-key.pem"
2022-04-02T11:16:22.366Z	INFO
2022-04-02T11:16:22.366Z	INFO	???? If you are behind a reverse proxy, you can either install the RootCA on the proxy machine trust store, or configure your proxy to `insecure_skip_verify` for pointing to Cells.
2022-04-02T11:16:22.367Z	INFO	???? If you are developing locally, you may install the RootCA in your system trust store to see a green light in your browser!
2022-04-02T11:16:22.367Z	INFO	???? To easily install the RootCA in your trust store, use https://github.com/FiloSottile/mkcert. Set the $CAROOT environment variable to the rootCA folder then use 'mkcert -install'
2022-04-02T11:16:22.367Z	INFO
2022-04-02T11:16:22.367Z	INFO	Activating privacy features... done.
2022-04-02T11:16:22.367Z	INFO	https://0.0.0.0:8080
2022-04-02T11:16:22.367Z	INFO	WARNING: File descriptor limit 1024 is too low for production servers. At least 8192 is recommended. Fix with "ulimit -n 8192".
2022-04-02T11:16:24.365Z	INFO	pydio.gateway.proxy	Restarting proxy	{"caddyfile": "\n\n0.0.0.0:8080 {\n\troot \"/root/.config/pydio/cells/static/install\"\n\tproxy /install [::]:38327\n\n\t\n\ttls \"/root/.config/pydio/cells/certs/e6de382e6f121a9072d77b25ba622a36.pem\" \"/root/.config/pydio/cells/certs/e6de382e6f121a9072d77b25ba622a36-key.pem\"\n}\n\n\n\n\t "}
2022-04-02T11:16:24.868Z	INFO	pydio.gateway.proxy	Restart done
Opening URL https://0.0.0.0:8080 in your browser. Please copy/paste it if the browser is not on the same machine.

Trình hướng dẫn cài đặt web Access Pydio Cells​

Lúc này, Pydio Cells đã được khởi động và lắng nghe trên cổng 8080. Bạn có thể truy cập bằng URL . Bạn sẽ thấy trang Thỏa thuận cấp phép Pydio Cells:


data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22750%22%20height=%22377%22%3E%3C/svg%3E


Đồng ý với Thỏa thuận cấp phép và nhấp vào nút TIẾP THEO. Bạn sẽ thấy trang cấu hình cơ sở dữ liệu.


data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22750%22%20height=%22384%22%3E%3C/svg%3E


Cung cấp cấu hình cơ sở dữ liệu của bạn và nhấp vào nút TIẾP THEO. Bạn sẽ thấy trang tạo người dùng quản trị:


data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22750%22%20height=%22374%22%3E%3C/svg%3E


Cung cấp tên người dùng quản trị, mật khẩu và nhấp vào nút TIẾP THEO. Bạn sẽ thấy trang sau:


data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22750%22%20height=%22394%22%3E%3C/svg%3E


Bây giờ, hãy nhấp vào nút CÀI ĐẶT NGAY. Bạn sẽ thấy trang đăng nhập Pydio Cells:


data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22750%22%20height=%22393%22%3E%3C/svg%3E


Cung cấp tên người dùng quản trị, mật khẩu và nhấp vào nút ENTER. Bạn sẽ thấy bảng điều khiển Pydio trên trang sau:


data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22750%22%20height=%22337%22%3E%3C/svg%3E

Tạo trường dịch vụ Systemd cho Pydio Cells​

Tiếp theo, bạn sẽ cần tạo tệp dịch vụ systemd để quản lý dịch vụ Pydio. Đầu tiên, nhấn CTRL+C để dừng dịch vụ Pydio, sau đó tạo tệp dịch vụ systemd bằng lệnh sau:
Mã:
nano /etc/systemd/system/cells.service
Thêm các dòng sau:
Mã:
[Unit]
Description=Pydio Cells
Documentation=https://pydio.com
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/usr/bin/cells
[Service]
User=root
Group=root
PermissionsStartOnly=true
AmbientCapabilities=CAP_NET_BIND_SERVICE
ExecStart=/usr/bin/cells start
Restart=on-failure
StandardOutput=journal
StandardError=inherit
LimitNOFILE=65536
TimeoutStopSec=5
KillSignal=INT
SendSIGKILL=yes
SuccessExitStatus=0
WorkingDirectory=/root
[Install]
WantedBy=multi-user.target
Lưu và đóng tệp sau đó tải lại daemon systemd để áp dụng các thay đổi:
Mã:
systemctl daemon-reload
Tiếp theo, hãy khởi động và kích hoạt dịch vụ Pydio bằng lệnh sau lệnh:
Mã:
systemctl enable cells
systemctl start cells
Bạn cũng có thể kiểm tra trạng thái Pydio bằng lệnh sau:
Mã:
systemctl status cells
Bạn sẽ nhận được thông tin sau output:
Mã:
? cells.service - Pydio Cells Loaded: loaded (/etc/systemd/system/cells.service; disabled; vendor preset: enabled) Active: active (running) since Sat 2022-04-02 11:34:24 UTC; 6s ago Docs: https://pydio.com Main PID: 25764 (cells) Tasks: 119 (limit: 2341) Memory: 421.6M CPU: 4.114s CGroup: /system.slice/cells.service ??25764 /usr/bin/cells start ??25769 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.jobs$ ??25775 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.search$ ??25781 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.gateway.websocket$ ??25783 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.sync.pydiods1$ ??25787 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.sync.personal$ ??25790 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.sync.cellsdata$ ??25802 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.sync.versions$ ??25805 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.sync.thumbnail> ??25816 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.tasks$ ??25819 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.objects.local1$ ??25847 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.index.pydiods1$ ??25848 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.index.personal$ ??25849 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.index.cellsdat> ??25850 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.index.versions$ ??25851 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.index.thumbnai>
Apr 02 11:34:29 debian11 cells[25764]: 2022-04-02T11:34:29.294Z INFO pydio.test.objects Started
Apr 02 11:34:29 debian11 cells[25764]: 2022-04-02T11:34:29.307Z INFO pydio.gateway.grpc Activating self-signed configura>
Apr 02 11:34:29 debian11 cells[25764]: 2022-04-02T11:34:29.308Z INFO pydio.gateway.grpc Started
Apr 02 11:34:30 debian11 cells[25764]: 2022-04-02T11:34:30.191Z INFO pydio.grpc.data.index.pydiods1 Warning: no private >
Apr 02 11:34:30 debian11 cells[25764]: 2022-04-02T11:34:30.194Z INFO pydio.grpc.data.index.personal Warning: no private >
Apr 02 11:34:30 debian11 cells[25764]: 2022-04-02T11:34:30.195Z INFO pydio.grpc.data.index.cellsdata Warning: no private>
Apr 02 11:34:30 debian11 cells[25764]: 2022-04-02T11:34:30.204Z INFO pydio.grpc.data.index.thumbnails Warning: no privat>
Apr 02 11:34:30 debian11 cells[25764]: 2022-04-02T11:34:30.212Z INFO pydio.grpc.data.index.versions Warning: no private >
Apr 02 11:34:30 debian11 cells[25764]: 2022-04-02T11:34:30.326Z INFO pydio.gateway.proxy Restarting proxy {"caddy>

Kết luận



Xin chúc mừng! bạn đã cài đặt và cấu hình Pydio Cells thành công trên Debian 11. Bây giờ bạn có thể tải lên các tệp, tài liệu và hình ảnh của mình từ bảng điều khiển Pydio và truy cập từ bất kỳ trình duyệt web hoặc thiết bị di động nào. Hãy thoải mái hỏi tôi nếu bạn có bất kỳ câu hỏi nào.
 
Back
Bên trên