本指南提供了在 CentOS 8、Rocky Linux 8、AlmaLinux 8 和 Fedora Server 40 上安裝 Pterodactyl v1.X 的全面說明,包括所有依賴項。
[[目錄]]
如果啟用了 SELinux(使用 sestatus 檢查),請安裝下列軟體包:
sudo dnf install -y policycoreutils selinux-policy selinux-policy-targeted setroubleshoot-server setools setools-console mcstrans
執行以下命令來安裝所有必要的依賴項:
# Update system
sudo dnf update -y
# Install EPEL and Remi repository
sudo dnf install -y epel-release
# Add additional repositories for PHP (Enterprise Linux 8)
sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
# Add additional repositories for PHP (Fedora Server 40)
sudo dnf install -y https://rpms.remirepo.net/fedora/remi-release-40.rpm
# Enable PHP 8.3 from Remi
sudo dnf module reset php
sudo dnf module enable php:remi-8.3 -y
# Install dependencies
sudo dnf install -y php php-{common,cli,gd,mysql,mbstring,bcmath,xml,fpm,curl,zip} mariadb mariadb-server nginx redis zip unzip tar
# Start and enable services
sudo systemctl enable --now mariadb nginx redis
# Configure firewall
sudo firewall-cmd --add-service=http --permanent
sudo firewall-cmd --add-service=https --permanent
sudo firewall-cmd --reload
# Install Composer
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
在 /etc/php-fpm.d/www-pterodactyl.conf 中建立一個新的 PHP-FPM 設定檔:
[pterodactyl]
user = nginx
group = nginx
listen = /var/run/php-fpm/pterodactyl.sock
listen.owner = nginx
listen.group = nginx
listen.mode = 0750
pm = ondemand
pm.max_children = 9
pm.process_idle_timeout = 10s
pm.max_requests = 200
啟動並啟用 PHP-FPM:
sudo systemctl enable --now php-fpm
太好了,我們現在已經安裝並配置了所有必需的依賴項。從這裡開始,遵循 official Panel installation documentation 。
::: 提示
您需要將 Nginx 設定中的 fastcgi_pass 路徑變更為 /var/run/php-fpm/pterodactyl.sock
:::