ComusThumbz 文档
管理员登录

常见服务器设置

概览

本指南涵盖了ComusThumbz所使用的最常见的托管环境的分步服务器配置. 每个部分提供完整的设置指令,包括PHP配置,网络服务器设置,以及ComusThumbz的特定要求.

需要配置 :
在启动前,请确保您的服务器符合您在 要求指南。 。 。 。

支持的环境

环境复杂性最佳服务PHP 配置访问
HestiaCP 化学反应轻点VPS,专用服务器完全进入
c小组/WHM轻点共享, VPS 托管限于多PHP
普莱斯克语Name轻点VPS,专用服务器完全进入
乌本图 + Apache中型VPS,云服务器完全进入
Ubuntu + Nginx 语法中型VPS,云服务器完全进入
CentOS/阿拉木图中型企业,专用完全进入
夹克高级可扩展的发展全控
云层轻点管理云面板访问

HestiaCP 设置

HestiaCP是VPS服务器的受欢迎的自由控制面板. 本设置指南涵盖完整的ComusThumbz安装.

先决条件

  • Ubuntu 20.04/22.04 或 Debian 10/11
  • 安装了 HestiaCP
  • 域指向服务器
  • SSH 访问

第1步: 创建网络域

  1. 登录到 HestiaCP 时间 https://your-server-ip:8083
  2. 转到 韦伯 选项卡
  3. 点击 添加网络域
  4. 输入您的域名
  5. 启用 SSL 支持 检查 让我们加密
  6. 点击 保存

[相片:hestiacp-add-domain] (英语).

步骤2: 配置 PHP

  1. 转到 韦伯 选项卡
  2. 单击域旁的扳手图标
  3. 选择 第8.3页 从 PHP 版本下拉
  4. 点击 保存

步骤 3: 启用所需的前一頁函数

警告:
HestiaCP 默认会禁用许多 PHP 函数 。 你必须让他们为ComusThumbz工作。

备选案文A:HestiaCP 小组讨论会

  1. 转到 公务员 > 翻译: 配置 > 翻译: PHP-FPM 移动
  2. 查找您的 PHP 版本( 如 PHP 8. 3)
  3. 地点 disablefunctions 在配置中
  4. 从禁用列表中删除这些函数 :

exec

  • shellexec
  • passthru
  • procopen
  • popen
  1. 点击 保存
  2. 重新启动 PHP : 在 SSH 中, 运行 systemctl restart php8.3-fpm

备选案文B:通过SSH(建议)

# Edit PHP configuration
sudo nano /etc/php/8.3/fpm/php.ini

查找已禁用函数行(约314行)

从 :

disablefunctions = exec,passthru,shellexec,system,procopen,popen,...

更改为( 取消执行 、 通过 、 空壳 )执行,Proc打开, 打开 :

disablefunctions = system,...

保存并重新启动 PHP- FPM

sudo systemctl restart php8.3-fpm

步骤 4: 调整 PHP 设置

# Edit PHP configuration
sudo nano /etc/php/8.3/fpm/php.ini

更新这些设置 :

memorylimit = 512M
maxexecutiontime = 600
uploadmaxfilesize = 500M
postmaxsize = 500M
maxinputvars = 10000

保存并重新启动

sudo systemctl restart php8.3-fpm

步骤5:安装FFmpeg

sudo apt update
sudo apt install ffmpeg

验证安装

ffmpeg -version
which ffmpeg  # Should return /usr/bin/ffmpeg

步骤6:安装图像Magick(可选)

sudo apt install imagemagick php8.3-imagick
sudo systemctl restart php8.3-fpm

第7步:上传ComusThumbz文件

Via 文件管理器 :

在HestiaCP, 转到 图表

  1. 导航到 /home/username/web/yourdomain.com/publichtml/
  2. 上传并提取 ComusThumbz 文件

(原始内容存档于2018-03-29). Via SFTP:

# Connect with SFTP client (FileZilla, WinSCP)

主机: 您的服务器
用户名: 您的 HestiaCP 用户
密码: 您的 HestiaCP 密码
Upload to: /home/username/web/yourdomain.com/public_html/

步骤8:设置权限

# SSH into your server
cd /home/username/web/yourdomain.com/publichtml

设定所有权

chown -R username:username ct/

设置基本权限

find ct/ -type d -exec chmod 755 {} \;
find ct/ -type f -exec chmod 644 {} \;

使上传/ 日志目录可写入

chmod -R 775 ct/logs ct/uploads ct/cache
chmod 777 ct/uploads/temp ct/uploads/temp/useruploads

第9步:设置 Cron 任务

  1. SSH 进入您的服务器
  2. 运行 : crontab -e
  3. 添加此行 :
/usr/bin/php /home/username/web/yourdomain.com/publichtml/ct/admin/cron/sitecron.php >> /home/username/web/yourdomain.com/publichtml/ct/logs/cron/sitecron.log 2>&1
OR
php /home/username/web/yourdomain.com/publichtml/ct/admin/cron/sitecron.php >> /home/username/web/yourdomain.com/publichtml/ct/logs/cron/sitecron.log 2>&1

第10步: 运行安装器

  1. 导航到 https://yourdomain.com/install/
  2. 跟随安装向导
  3. 删除 /install/ 完成后文件夹
成功 :
您的 HestiaCP 服务器现已配置为 ComusThumbz !

c小组/ WHM 设置

cPanel是最常见的共享主机控制面板. 本指南涵盖与cPanel共用和VPS托管的设置.

先决条件

  • c 小组托管账户
  • PHP 8.0+ 可选
  • SSH 访问( 可选但推荐)

第 1 步: 选择首选项版本

  1. 登录到 cPanel
  2. 转到 软件 > 翻译: 多 PHP 管理器
  3. 选择您的域
  4. 选择 第8.3页 (或最高可用8.x)
  5. 点击 应用

[相机:cpanel-php-version] (中文(简体) ).

第2步: 配置 PHP 设置

  1. 转到 软件 > 翻译: MultiPHP INI 编辑器
  2. 选择 编辑器模式
  3. 选择您的域
  4. 更新这些设置 :
  • memorylimit = 512M
  • maxexecutiontime = 600
  • uploadmaxfilesize = 500M
  • postmaxsize = 500M
  • maxinputvars = 10000
  1. 点击 保存

步骤 3: 启用 PHP 函数

警告:
在共享托管时, 您可能无法启用已禁用功能 。 如果这些功能被禁用, 请联系您的主机 。

如果你有WHM访问:

  1. 登录到 WHM
  2. 转到 服务配置 > 翻译: 前一頁 配置编辑器
  3. 查找 disablefunctions
  4. 删除 : exec, shellexec, passthru, procopen, popen
  5. 保存并重建 PHP

关于共享托管:
联系您的主机提供商为您的账户启用这些功能 。

步骤 4: 上传文件

转到 文件 > 翻译: 文件管理器

  1. 导航到 publichtml/
  2. 点击 上传
  3. 上传并提取 ComusThumbz 文件

或使用 FTP :

  • 主机:您domain.com或ftp.yourdomain.com 页面存档备份,存于互联网档案馆.
  • 用户名: 您的 cPanel 用户名
  • 密码:您的 cPanel 密码

第5步:建立数据库

  1. 转到 数据库 > 翻译: MySQL 数据库
  2. 创建一个新的数据库(例如, usernamecomus(中文(简体) ).
  3. 创建一个密码很强的新用户
  4. 将用户添加到数据库 所有特权

第6步: 设置 Cron 任务

转到 高级 > 翻译: Cron 任务

  1. 设定时间表 : (每分钟)
  2. 命令 :
/usr/bin/php /home/username/web/yourdomain.com/publichtml/ct/admin/cron/sitecron.php >> /home/username/web/yourdomain.com/publichtml/ct/logs/cron/sitecron.log 2>&1
OR
php /home/username/web/yourdomain.com/publichtml/ct/admin/cron/sitecron.php >> /home/username/web/yourdomain.com/publichtml/ct/logs/cron/sitecron.log 2>&1
  1. 点击 添加新编程任务

第7步:运行安装器

导航到 https://yourdomain.com/install/ 并完成安装。


Plesk 设置

Plesk是VPS和专用服务器的流行控制面板.

步骤1:添加域

  1. 登录到 Plesk
  2. 转到 网站和域数
  3. 点击 添加域
  4. 输入您的域并配置设置
  5. 启用 SSL/TLS 支持

步骤2: 配置 PHP

  1. 转到 网站和域数 > 您的域 > 前一頁 设置
  2. 设定 前一頁 版本 改为8.3
  3. 配置 :
  • memorylimit = 512M
  • maxexecutiontime = 600
  • uploadmaxfilesize = 500M
  • postmaxsize = 500M
  1. 点击

步骤 3: 启用 PHP 函数

  1. 转到 前一頁 设置 用于您的域
  2. 查找 其他指示
  3. 添加:
disablefunctions =

(Empty 值删除所有已禁用的函数)

  1. 或者通过从禁用列表中删除特定功能来有选择地启用

步骤 4: 安装 FFmpeg

维娅・SSH:

# Ubuntu/Debian
sudo apt install ffmpeg

CentOS 服务器

sudo yum install ffmpeg

第5步:设置 Cron 任务

  1. 转到 网站和域数 > 您的域 > 计划任务
  2. 点击 添加任务
  3. 时间表:每分钟 (中文(简体) ).
  4. 命令 :

/usr/bin/php /home/username/web/yourdomain.com/publichtml/ct/admin/cron/sitecron.php >> /home/username/web/yourdomain.com/publichtml/ct/logs/cron/sitecron.log 2>&1
OR
php /home/username/web/yourdomain.com/publichtml/ct/admin/cron/sitecron.php >> /home/username/web/yourdomain.com/publichtml/ct/logs/cron/sitecron.log 2>&1

第6步:上传并安装

  1. 通过 FTP 或文件管理器上传文件
  2. 设置权限
  3. 运行安装器于 https://yourdomain.com/install/

Ubuntu + Apache( 手动设置)

用于VPS或没有控制面板的专用服务器.

步骤1:更新系统

sudo apt update
sudo apt upgrade -y

第2步:安装Apache

sudo apt install apache2 -y
sudo systemctl enable apache2
sudo systemctl start apache2

步骤3:安装PHP 8.3

# Add PHP repository
sudo add-apt-repository ppa:ondrej/php -y
sudo apt update

Install PHP and extensions

sudo apt install php8.3 php8.3-fpm php8.3-mysql php8.3-gd php8.3-curl \
    php8.3-mbstring php8.3-xml php8.3-zip php8.3-imagick php8.3-intl -y

Enable PHP-FPM with Apache

sudo a2enmod proxyfcgi setenvif
sudo a2enconf php8.3-fpm
sudo systemctl restart apache2

Step 4: Install MySQL/MariaDB

sudo apt install mariadb-server -y
sudo mysqlsecureinstallation

Create database and user

sudo mysql -u root -p

CREATE DATABASE comusthumbz CHARACTER SET utf8mb4 COLLATE utf8mb4unicodeci;
CREATE USER 'comususer'@'localhost' IDENTIFIED BY 'YourSecurePassword123!';
GRANT ALL PRIVILEGES ON comusthumbz. TO 'comususer'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 5: Install FFmpeg

sudo apt install ffmpeg -y
which ffmpeg  # Should return /usr/bin/ffmpeg

Step 6: Configure PHP

sudo nano /etc/php/8.3/fpm/php.ini

Update these settings:

memorylimit = 512M
maxexecutiontime = 600
uploadmaxfilesize = 500M
postmaxsize = 500M
maxinputvars = 10000
date.timezone = America/NewYork
; Ensure exec and related functions are NOT in disablefunctions
sudo systemctl restart php8.3-fpm

Step 7: Configure Apache Virtual Host

sudo nano /etc/apache2/sites-available/yourdomain.com.conf
<VirtualHost :80>
    ServerName yourdomain.com
    ServerAlias www.yourdomain.com
    DocumentRoot /var/www/yourdomain.com
<Directory /var/www/yourdomain.com>
AllowOverride All
Require all granted
</Directory>
<FilesMatch \.php$>
SetHandler "proxy:unix:/var/run/php/php8.3-fpm.sock|fcgi://localhost"
</FilesMatch>
ErrorLog ${APACHELOGDIR}/yourdomain.com-error.log
CustomLog ${APACHELOGDIR}/yourdomain.com-access.log combined
</VirtualHost>
# Enable site and required modules
sudo a2ensite yourdomain.com.conf
sudo a2enmod rewrite headers expires deflate
sudo systemctl restart apache2

Step 8: Install SSL (Let's Encrypt)

sudo apt install certbot python3-certbot-apache -y
sudo certbot --apache -d yourdomain.com -d www.yourdomain.com

Step 9: Upload ComusThumbz

# Create document root
sudo mkdir -p /var/www/yourdomain.com

Upload files (via SCP, SFTP, or wget)

cd /var/www/yourdomain.com

... upload files ...

Set ownership

sudo chown -R www-data:www-data /var/www/yourdomain.com

Set permissions

sudo find /var/www/yourdomain.com -type d -exec chmod 755 {} \;
sudo find /var/www/yourdomain.com -type f -exec chmod 644 {} \;
sudo chmod -R 775 /var/www/yourdomain.com/ct/logs /var/www/yourdomain.com/ct/uploads

Step 10: Set Up Cron Job

sudo crontab -e

Add:

/usr/bin/php /home/username/web/yourdomain.com/publichtml/ct/admin/cron/sitecron.php >> /home/username/web/yourdomain.com/publichtml/ct/logs/cron/sitecron.log 2>&1
OR
php /home/username/web/yourdomain.com/publichtml/ct/admin/cron/sitecron.php >> /home/username/web/yourdomain.com/publichtml/ct/logs/cron/sitecron.log 2>&1

Ubuntu + Nginx Setup

Nginx is recommended for high-traffic sites due to its efficient handling of static files and concurrent connections.

Step 1: Install Nginx and PHP

sudo apt update
sudo apt install nginx -y

Install PHP-FPM

sudo add-apt-repository ppa:ondrej/php -y
sudo apt update
sudo apt install php8.3-fpm php8.3-mysql php8.3-gd php8.3-curl \
    php8.3-mbstring php8.3-xml php8.3-zip php8.3-imagick -y

Step 2: Configure Nginx

sudo nano /etc/nginx/sites-available/yourdomain.com
server {
    listen 80;
    listen [::]:80;
    servername yourdomain.com www.yourdomain.com;
    root /var/www/yourdomain.com;
    index index.php index.html;
	
# Security headers
addheader X-Frame-Options "SAMEORIGIN" always;
addheader X-Content-Type-Options "nosniff" always;
addheader X-XSS-Protection "1; mode=block" always;

# Main location block
location / {
tryfiles $uri $uri/ /index.php?$querystring;
}

# REST API rewrite
location /ct/api/v1 {
tryfiles $uri $uri/ /ct/api/v1/index.php?$querystring;
}

# PHP processing
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgipass unix:/var/run/php/php8.3-fpm.sock;
fastcgiparam SCRIPTFILENAME $documentroot$fastcgiscriptname;
include fastcgiparams;
}

# Deny access to sensitive directories
location ~ ^/ct/(dat|logs)/ {
deny all;
return 404;
}

# Cache static files
location ~ \.(jpg|jpeg|png|gif|webp|ico|css|js|mp4|webm|m3u8|ts)$ {
expires 30d;
addheader Cache-Control "public, immutable";
}

# Deny access to hidden files
location ~ /\. {
deny all;
}
}

 

# Enable site
sudo ln -s /etc/nginx/sites-available/yourdomain.com /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx

Step 3: Configure PHP-FPM

sudo nano /etc/php/8.3/fpm/php.ini

Update settings as shown in the Apache section, then:

sudo systemctl restart php8.3-fpm

Step 4: Install SSL

sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com

Step 5: Continue with Steps 4-10 from Apache Guide

(Database setup, FFmpeg, upload files, permissions, cron)


CentOS / AlmaLinux Setup

Step 1: Install EPEL and Required Repositories

# CentOS/RHEL 8+
sudo dnf install epel-release -y
sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm -y

Enable Remi PHP 8.3

sudo dnf module reset php -y
sudo dnf module enable php:remi-8.3 -y

Step 2: Install Apache, PHP, and Extensions

sudo dnf install httpd php php-fpm php-mysqlnd php-gd php-curl \
    php-mbstring php-xml php-zip php-imagick -y
sudo systemctl enable httpd php-fpm

sudo systemctl start httpd php-fpm

Step 3: Install MariaDB

sudo dnf install mariadb-server -y
sudo systemctl enable mariadb
sudo systemctl start mariadb
sudo mysqlsecureinstallation

Step 4: Install FFmpeg

# Enable RPM Fusion
sudo dnf install https://download1.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm -y
sudo dnf install ffmpeg -y

Step 5: Configure PHP

sudo nano /etc/php.ini

Update settings as described in previous sections.

sudo systemctl restart php-fpm

Step 6: Configure SELinux (if enabled)

# Allow Apache to connect to network (for API calls)
sudo setsebool -P httpdcannetworkconnect 1

Allow Apache to write to upload directories

sudo chcon -R -t httpdsysrwcontentt /var/www/yourdomain.com/ct/uploads
sudo chcon -R -t httpdsysrwcontentt /var/www/yourdomain.com/ct/logs

Step 7: Configure Firewall

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload

 

Troubleshooting Common Setup Issues

"exec() has been disabled" Error

Error:
Symptoms: Video processing fails, FFmpeg errors.

 

Solution: Enable exec() in PHP configuration. See platform-specific instructions above.

"Permission denied" Errors

Error:
Symptoms: Cannot upload files, cannot save settings.

Solution:

chown -R www-data:www-data /path/to/ct/

chmod -R 775 /path/to/ct/logs /path/to/ct/uploads

Cron Job Not Running

Error:
Symptoms: Videos stay in "pending" status.

Verify cron:

# Check cron is running

systemctl status cron

Check cron log

grep CRON /var/log/syslog

Test manually

php /path/to/ct/admin/cron/sitecron.php

500 Internal Server Error

Error:
Symptoms: Blank page or 500 error.

Solutions:

  1. Check PHP error log: tail -f /path/to/ct/logs/php-error.log
  2. Check Apache/Nginx error log
  3. Verify .htaccess is valid
  4. Check file permissions

API Returns 404

Error:
Symptoms: REST API endpoints return 404.

 

Apache: Ensure modrewrite is enabled and AllowOverride All is set.

Nginx: Ensure the API rewrite rule is in your server block:

location /ct/api/v1 {

    tryfiles $uri $uri/ /ct/api/v1/index.php?$querystring;

}


Changelog

Date Version Changes
2026-01-02 1.0.0 Initial server setups guide