Documentação ComusThumbz
Login de Admin

Installer

ComusThumbz Installation System

Document Version: 1.0.0
Last Updated: 2026-01-02
Applies To: ComusThumbz v1.11.14+
Location: /install/index.php


Overview

The ComusThumbz Installation System is a comprehensive 7-stage web-based installer that guides users through the complete setup of a new ComusThumbz installation. The installer handles everything from verifying server requirements to creating database tables, generating configuration files, setting up folder permissions, and creating the administrator account.

[Screenshot: installer-welcome-screen]

Key Features

  • 7-Stage Installation Process - Guided step-by-step setup
  • Real-Time Requirement Checking - Validates PHP, MySQL, and external tools
  • Batch Database Import - Handles large schema files without timeout
  • Dynamic Configuration Generator - Creates config.inc.php with user-provided values
  • Folder Permission Management - Creates required directories with proper security
  • Password Strength Validation - Enforces strong admin passwords
  • Reset Functionality - Allows starting over including database cleanup

System Requirements

Configuration Required:
Before running the installer, ensure your server meets these minimum requirements. The installer will check these automatically in Stage 1.

PHP Requirements

Requirement Minimum Recommended Notes
PHP Version 8.0 8.3+ Required for modern features
memorylimit 256M 512M For large schema import
maxexecutiontime 300 600 For database operations
uploadmaxfilesize 100M 500M For video uploads (post-install)
postmaxsize 100M 500M Must be >= uploadmaxfilesize

Required PHP Extensions

Extension Required Purpose
PDO ✅ Yes Database connections
pdomysql ✅ Yes MySQL/MariaDB support
mysqli ✅ Yes Legacy database support
GD ✅ Yes Image processing
cURL ✅ Yes API calls, license verification
mbstring ✅ Yes Multibyte string handling
json ✅ Yes JSON encoding/decoding
session ✅ Yes Session management
fileinfo ✅ Yes MIME type detection
openssl ✅ Yes Secure random generation
zip ⚠️ Optional Backup/export features

Required PHP Functions

Warning:
These functions must NOT be in disablefunctions in php.ini:
Function Required For
exec() FFmpeg/FFprobe execution (post-install)
shellexec() Command-line tools (post-install)
fileputcontents() Configuration file creation
mkdir() Folder structure creation
chmod() Permission management

External Tools (Verified in Stage 1)

Tool Required Version Check Command
FFmpeg ✅ Yes 4.0+ ffmpeg -version
FFprobe ✅ Yes 4.0+ ffprobe -version
ImageMagick ⚡ Recommended 7.0+ convert -version

Server Requirements

Component Requirement
Web Server Apache 2.4+ with modrewrite OR Nginx
Database MySQL 5.7+ / MariaDB 10.3+
Disk Space 500MB minimum for installation
SSL Recommended for production

Installation Requirements

Database Tables Created

The installer creates over 200 database tables through the schema file. Key tables created include:

Note: The complete schema is stored in /install/schema/schemacomplete.sql and contains all table definitions, indexes, and default data.

Config Variables Generated

The installer generates ct/dat/config.inc.php with the following configurable values:

// Database Configuration
$dbhost = 'localhost';           // Database host
$db = 'databasename';           // Database name
$dbuser = 'databaseuser';       // Database username
$dbpasswd = 'password';          // Database password
$dbprefix = 'tbl';               // Table prefix

// Site Configuration
$domain = 'example.com'; // Site domain
$sitename = 'Site Name'; // Site name
$sitedesc = 'Description'; // Site description
$siteemail = 'admin@example.com'; // Admin email
$sitekeywords = 'keywords'; // SEO keywords
$sitepath = '/ct'; // Path to ct folder

 

// License Configuration
$licensekey = 'XXXX-XXXX-XXXX-XXXX';
$license
email = 'license@email.com';

 

// Image Sizing
$WSIZE = 220; // Thumbnail width
$HSIZE = 180; // Thumbnail height
$MODWSIZE = 260; // Model image width
$MODHSIZE = 400; // Model image height
$CATWSIZE = 260; // Category image width
$CATHSIZE = 400; // Category image height

 

// Error Handling
$error404URL = ''; // 404 redirect URL
$dberrorurl = ''; // Database error redirect

 

// Security
$jwtsecret = 'generatedsecret';
$pwhash = 'generatedhash';
$akey = 'generated
key';

Folders Created with Permissions

Folder Permission Purpose Critical
ct/dat 0755 Configuration files ✅ Yes
ct/logs 0775 Application and error logs ✅ Yes
ct/logs/api 0775 API request/response logs ✅ Yes
ct/logs/videoprocessor 0775 Video processing logs ✅ Yes
ct/logs/storageservers 0775 Storage/CDN logs ✅ Yes
ct/logs/cron 0775 Cron job logs ✅ Yes
ct/uploads 0775 User uploads (parent) ✅ Yes
ct/uploads/videos 0775 Video files ✅ Yes
ct/uploads/videos/original 0775 Original uploaded videos ✅ Yes
ct/uploads/videos/processed 0775 Transcoded videos ✅ Yes
ct/uploads/videos/thumbnails 0775 Video thumbnails ✅ Yes
ct/uploads/videos/hls 0775 HLS streaming segments ✅ Yes
ct/uploads/images 0775 Image uploads ✅ Yes
ct/uploads/galleries 0775 Gallery images ✅ Yes
ct/uploads/avatars 0775 User avatars ✅ Yes
ct/uploads/temp 0777 Temporary processing ✅ Yes
ct/uploads/temp/useruploads 0777 Temp user upload staging ✅ Yes
ct/uploads/ftpuploads 0775 Admin FTP bulk uploads ✅ Yes
ct/uploads/creatoravatars 0775 Creator profile images ✅ Yes
ct/uploads/creatorcovers 0775 Creator cover images ✅ Yes
ct/uploads/creatorposts 0775 Creator post media ✅ Yes
ct/cache 0775 Application cache ✅ Yes
ct/cache/templates 0775 Compiled template cache ✅ Yes
ct/cache/api 0775 API response cache ✅ Yes
ct/admin/exports 0755 Admin data exports ✅ Yes
ct/admin/backups 0755 Database backups ✅ Yes
assets/uploads 0775 Frontend assets ✅ Yes

Security Files Created

The installer creates .htaccess files to secure sensitive directories:

For /ct/logs, /ct/dat, /ct/cache:

Order deny,allow

Deny from all

For /ct/uploads and /assets/uploads:

# Prevent PHP execution

<FilesMatch "\.ph(p[3457]?|t|tml|ps)$">

    Order allow,deny

    Deny from all

</FilesMatch>

 

 

Allow media files

<FilesMatch "\.(jpg|jpeg|png|gif|webp|mp4|webm|m3u8|ts)$">
    Order allow,deny
    Allow from all
</FilesMatch>

Prevent directory listing

Options -Indexes

File Dependencies

File Location Purpose
index.php /install/ Main installer orchestrator
stage1requirements.php /install/stages/ System requirements check
stage2database.php /install/stages/ Database setup and schema import
stage3config.php /install/stages/ Configuration generator
stage4folders.php /install/stages/ Folder structure creation
stage5admin.php /install/stages/ Admin password setup
stage6data.php /install/stages/ Default data import
stage7finalize.php /install/stages/ Final verification
ajaxschema.php /install/ Batch SQL processor
schemacomplete.sql /install/schema/ Full database schema

Features & UI Elements

Header and Branding

[Screenshot: installer-header-branding]

The installer features a branded header with:

  • COMUSTHUMBZ Logo - Orbitron font with accent bar
  • Icon Row - Five feature icons (Video, Gallery, Models, Cams, Templates)
  • Progress Bar - Visual indicator of installation progress (stages 1-7)
  • Stage Navigation - Clickable stage indicators showing completion status

Stage Progress Indicators

Each stage shows one of three states:

  • Completed (Green checkmark) - Stage finished successfully
  • Current (Highlighted) - Active stage being worked on
  • Pending (Gray) - Not yet reached

Navigation Buttons

Button Location Purpose
Previous Bottom left Navigate to previous stage
Continue/Next Bottom right Submit form and proceed to next stage
Skip to Stage Stage indicators Jump to any completed stage

Stage-by-Stage Guide

Stage 1: System Requirements

[Screenshot: stage-1-requirements]

Purpose: Verify that the server meets all requirements for ComusThumbz.

Checks Performed:

  1. PHP Version - Must be 8.0 or higher
  2. Required Extensions:
  • PDO, pdomysql, mysqli
  • GD, cURL, mbstring, json
  • session, fileinfo, openssl
  1. Optional Extensions:
  • ImageMagick, zip, exif
  1. php.ini Settings:
  • memorylimit (256M minimum)
  • maxexecutiontime (300 seconds minimum)
  • postmaxsize, uploadmaxfilesize
  1. File Permissions:
  • /install/ writable
  • /ct/dat/ writable (or parent writable)
  1. External Tools:
  • FFmpeg availability
  • FFprobe availability
  • ImageMagick convert command

Status Indicators:

  • Passed - Requirement met
  • ⚠️ Warning - Recommended but not critical
  • Failed - Must be fixed before proceeding
Warning:
If critical requirements fail, you cannot proceed. Fix the issues on your server and refresh the page.

UI Elements:

  • Requirement cards grouped by category
  • Pass/Fail status badges
  • Expandable details for each check
  • "Re-check Requirements" button

Stage 2: Database Setup

[Screenshot: stage-2-database]

Purpose: Configure database connection and import the complete schema.

Form Fields:

Field Description Default
Database Host MySQL server address localhost
Database Name Name of the database (empty)
Database User MySQL username (empty)
Database Password MySQL password (hidden)
Table Prefix Prefix for all tables tbl
Tip: Create the database and user before running the installer. The installer will NOT create the database for you.

Process Flow:

  1. Enter database credentials
  2. Click "Test Connection" to verify
  3. If successful, click "Continue" to import schema
  4. Batch import processes SQL statements in groups of 20
  5. Progress bar shows import status (percentage complete)
  6. Results show success count and any errors

Batch Processing:

  • Uses AJAX to prevent timeout
  • Processes 20 statements per batch
  • Automatically continues until complete
  • Foreign key checks disabled during import
  • Errors logged but non-blocking for duplicates

 

[Screenshot: stage-2-batch-import-progress]

Error Handling:

  • Connection failures show specific error message
  • Schema import errors are collected and displayed
  • "Table already exists" errors are normal for re-runs

Stage 3: Configuration Generator

[Screenshot: stage-3-config]

Purpose: Generate the main configuration file ct/dat/config.inc.php.

Form Sections:

Site Information

Field Description Required
Site Name Display name for your site ✅ Yes
Admin Email Email for notifications ✅ Yes
Site Description Brief description for SEO No
Site Keywords Comma-separated keywords No

Path Configuration

Field Description
Site Path Path from document root to ct folder (e.g., /ct)
Timezone Server timezone for date/time functions
Note: The site path is auto-detected based on the installer location. Modify only if needed.

License Configuration

Field Description
Licensed Domain Auto-detected, read-only
License Key Your ComusThumbz license key (optional)
License Email Email used when purchasing license
Tip: A license is optional but recommended. Without a license, a small portion of traffic may be redirected for monetization.

Webmaster Information

Field Description
Webmaster Name Your name or company name

Error Handling URLs

Field Description
404 Error Redirect URL Where to redirect on page not found
Database Error Redirect URL Where to redirect on DB connection failure

Thumbnail Size Configuration

Field Default Description
Thumbnail Width 220px Standard content thumbnails
Thumbnail Height 180px Standard content thumbnails
Model Width 260px Model/performer images
Model Height 400px Model/performer images
Category Width 260px Category images
Category Height 400px Category images

Database Summary:

  • Displays configured database settings from Stage 2
  • Read-only confirmation of connection details

Output:

  • Generates complete config.inc.php file
  • Creates secure random keys (JWT secret, password hash, etc.)
  • Sets timezone and logging configuration
Warning:
If the config file cannot be written automatically, the content is displayed for manual copy/paste.

Stage 4: Folder Structure

[Screenshot: stage-4-folders]

Purpose: Create all required directories with proper permissions.

Folder Categories:

Core Directories - ct/dat, ct/logs

  1. Log Directories - api, videoprocessor, storageservers, cron
  2. Upload Directories - videos, images, galleries, avatars, temp
  3. Creator Directories - creatoravatars, creatorcovers, creatorposts
  4. Cache Directories - templates, api
  5. Admin Directories - exports, backups
  6. Frontend Directories - assets/uploads

Status Indicators:

  • 🟢 Ready - Folder exists and is writable
  • 🟡 Will Create - Folder will be created
  • 🔴 Not Writable - Exists but permissions need fixing

Summary Statistics:

  • Total Folders: Count of all required directories
  • Already Ready: Directories that already exist and are writable
  • To Create: Directories that will be created

Security Files:
After folder creation, .htaccess files are automatically added to:

  • Prevent direct access to logs and config
  • Block PHP execution in upload directories
  • Disable directory listing
Tip:
If folders fail to create, you may need to manually create them with proper ownership (www-data or your web server user).

Stage 5: Default Data Import

[Screenshot: stage-5-data-import]

Purpose: Import essential default data for the system to function.

Import Options:

Option Description Required
Admin Menu Structure Navigation menus for admin panel (40+ items) ✅ Yes
Default Settings Site configuration defaults ✅ Yes
Sample Categories 8 starter content categories No

Menu Categories Created:

  • Help (Documentation, Getting Started, FAQ, Support)
  • Import (Video Import, Gallery Import, FTP Uploads, CSV Import)
  • Database (Videos, Galleries, Models, Categories, Tags)
  • Engine (Page Builder, Widgets, Components)
  • Templates (Template Manager, File Editor, Style Manager)
  • Pages (All Pages, Create Page, Menu Manager)
  • Traffic (Click Reports, Analytics, Sources)
  • Reports (Dashboard, Video Stats, User Activity, Revenue)
  • Robots (Cron Jobs, Scheduled Tasks, Processing Queue)
  • Tools (Storage Servers, Video Processor, Cache Manager, API Tester)
  • Multi (Sites, Sync Settings)
  • Settings (General, Users, Feature Toggles, Creators, License, Backups)

Sample Categories Created:

  • Popular, Recent, Featured, Trending
  • HD, Amateur, Professional, Vintage
Note:
If data was already imported during schema creation (Stage 2), the import will show "Already imported" and skip those items.

Stage 6: Admin Password

[Screenshot: stage-6-admin-password]

Purpose: Set the administrator password for accessing the admin panel.

Warning:
The admin panel uses password-only authentication. There is no username - just the password. Keep it secure!

Password Requirements:

  • Minimum 8 characters
  • At least one uppercase letter (A-Z)
  • At least one lowercase letter (a-z)
  • At least one number (0-9)
  • At least one special character (!@#$%^&)

UI Features:

  • Password visibility toggle (eye icon)
  • Real-time requirement checklist
  • Password strength meter (Weak → Fair → Good → Strong)
  • Visual feedback as you type

Security Recommendations Displayed:

  • Use a unique password
  • Store in a secure password manager
  • Enable 2FA after installation

Storage:

  • Password is hashed using bcrypt (PASSWORDBCRYPT)
  • Stored in tblSettings.adminpassword column
  • Also written to config.inc.php for legacy auth

 


Stage 7: Finalization

[Screenshot: stage-7-finalization]

Purpose: Perform final verification and complete the installation.

Final Verification Checks:

Check Description
Configuration File Verifies config.inc.php exists and is readable
Database Connection Tests connection with configured credentials
Database Tables Confirms essential tables exist (Settings, CMSUsers, Menus, Categories, FeatureToggles)
Admin Password Verifies password is set in tblSettings
Log Directory Confirms log folder is writable
Upload Directory Confirms upload folder is writable

Installation Summary:

  • Site Information (name, email, path)
  • Database Details (host, name)
  • Admin Login URL with password display
  • System Info (version, PHP version, server)

Post-Installation Security Reminders:

  1. Delete Install Directory - Remove /install folder after completion
  2. Secure Config Files - Set config.inc.php to 644 permissions
  3. Enable Two-Factor Authentication - Set up 2FA in admin settings
  4. License Registration - Register at comusthumbz.com

What's Next Steps:

  1. Access Admin Panel
  2. Configure Settings
  3. Setup Content (import videos, galleries)
  4. Configure Cron Jobs

 

Installation Marker:
Creates ct/dat/.installed file containing:

{

  "installedat": "2026-01-02 10:30:00",

  "version": "1.11.14",

  "installerversion": "1.0.0",

  "siteemail": "admin@example.com",

  "sitename": "ComusThumbz"

}

 


Welcome Screen (Stage 0)

[Screenshot: installer-welcome-screen-full]

Purpose: Landing page before starting installation.

Elements:

  • Welcome message explaining ComusThumbz
  • "Before You Begin" checklist:
  • Database credentials ready
  • PHP 8.0+ with required extensions
  • Write permissions on installation directory
  • FFmpeg installed (for video processing)
  • Begin Installation button - Starts Stage 1
  • Resume Previous Installation - If session exists
  • Reset Installation button - Clears all progress and database tables

 


Reset Installation Feature

[Screenshot: reset-confirmation-dialog]

Purpose: Allow starting completely fresh if issues occur.

What Reset Does:

  1. Drops All Database Tables - Removes all tables with configured prefix
  2. Deletes Configuration File - Removes ct/dat/config.inc.php
  3. Clears Session Data - Resets all installation progress
  4. Returns to Welcome Screen - Fresh start

 

 

Warning:
Reset is destructive! All database tables with your configured prefix will be permanently deleted. This cannot be undone.

 

Confirmation Dialog:
Shows warning message requiring explicit confirmation before proceeding.

Error Handling:
If cleanup fails (e.g., database connection issues), warnings are displayed on the welcome screen but installation can still proceed.


Completion Screen

[Screenshot: installation-complete]

Purpose: Shown after successful completion of all 7 stages.

Elements:

  • Success celebration message with checkmark
  • Access Admin Panel button - Direct link to ctlogin.php
  • View Your Site button - Link to frontend
  • Final reminder to delete /install folder
  • Documentation link

 


Troubleshooting

Common Errors and Solutions

 

Error:
Error: "Could not connect to database"
  • Verify database exists and credentials are correct
  • Check MySQL service is running
  • Ensure user has proper permissions (SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP)

 

 

Error:
Error: "Failed to write config.inc.php"
  • Check that ct/dat/ directory exists and is writable
  • Verify web server user has write permissions (chown www-data:www-data ct/dat/)
  • As fallback, manually create the file with displayed content

 

 

Error:
Error: "Some critical folders could not be created"
  • SSH into server and create folders manually
  • Set ownership: chown -R www-data:www-data ct/
  • Set permissions: chmod -R 775 ct/uploads ct/logs ct/cache

 

 

Error:
Error: "Schema import timeout" or page hangs
The batch processor handles this automaticallyIf stuck, refresh page - progress is saved
  • Increase maxexecutiontime in php.ini if needed

 

 

Error:
Error: "Table already exists" during schema import
  • This is normal for re-runs or resumed installations
  • Errors are logged but won't block installation
  • Use Reset if you need a completely fresh database

 

 

Error:
Error: "Password requirements not met"
  • Ensure password has 8+ characters
  • Include uppercase, lowercase, number, and special character
  • Check the requirements checklist for missing items

 

Re-running the Installer

If you need to re-run the installer after completion:

  1. Delete the installation marker: rm ct/dat/.installed
  2. Navigate to /install/index.php
  3. Use Reset if you want a fresh database, or continue with existing tables

Manual Database Import

If batch import fails completely:

  1. Export your schema: cat install/schema/schemacomplete.sql
  2. Import via command line: mysql -u user -p database < schemacomplete.sql
  3. Resume installer from Stage 3

Security Considerations

During Installation

  • Installer uses sessions to store sensitive data
  • Database passwords are not logged
  • Generated secrets use cryptographically secure random bytes
  • CSRF protection via form tokens

After Installation

 

Warning:
CRITICAL: Delete the /install folder after completing installation!
Leaving it accessible allows anyone to potentially reinstall or view configuration details.

 

Recommended Post-Install Security:

  1. Delete entire /install/ directory
  2. Set config.inc.php to 644: chmod 644 ct/dat/config.inc.php
  3. Verify .htaccess files are in place
  4. Enable 2FA in admin panel
  5. Use HTTPS in production

Cron Jobs Required After Installation

After installation, set up this cron job for system maintenance:

# Main site cron - runs every minute
  • * php /path/to/ct/admin/cron/sitecron.php >> /path/to/ct/logs/cron/sitecron.log 2>&1

This single cron job handles:

  • Video processing queue
  • Scheduled tasks
  • Cache cleanup
  • Analytics aggregation
  • Subscription billing

 


Translatable Strings

The following text strings appear in the installer and may need translation for non-English installations:

Welcome Screen

  • "Welcome to ComusThumbz"
  • "High Powered Website Automation"
  • "Before You Begin"
  • "Begin Installation"
  • "Resume Previous Installation"
  • "Reset Installation"

Navigation

  • "Previous"
  • "Continue"
  • "Skip to Stage"
  • "Back to Start"

Stage 1 - Requirements

  • "System Requirements"
  • "Checking server compatibility"
  • "Passed", "Warning", "Failed"
  • "Re-check Requirements"

Stage 2 - Database

  • "Database Setup"
  • "Database Host", "Database Name", "Database User", "Database Password"
  • "Table Prefix"
  • "Test Connection"
  • "Import Schema"
  • "Processing..."

Stage 3 - Configuration

  • "Configuration Generator"
  • "Site Name", "Admin Email", "Site Description", "Site Keywords"
  • "Site Path", "Timezone"
  • "License Configuration"
  • "License Key", "License Email"
  • "Webmaster Name"
  • "Error Handling URLs"
  • "Thumbnail Size Configuration"

Stage 4 - Folders

  • "Folder Structure Setup"
  • "Required Directories"
  • "Security Files"
  • "Ready", "Will Create", "Not Writable"
  • "Create Folders"

Stage 5 - Data Import

  • "Default Data Import"
  • "Admin Menu Structure"
  • "Default Settings"
  • "Sample Categories"
  • "Required"

Stage 6 - Admin Password

  • "Admin Password Setup"
  • "Password", "Confirm Password"
  • "Password Requirements"
  • "Password Strength"
  • "Weak", "Fair", "Good", "Strong"

Stage 7 - Finalization

  • "Final Verification"
  • "Installation Summary"
  • "Post-Installation Security"
  • "What's Next"
  • "Complete Installation"

Completion Screen

  • "Installation Complete!"
  • "Access Admin Panel"
  • "View Your Site"
  • "Delete Install Folder"

Error Messages

  • "Could not connect to database"
  • "Failed to write configuration file"
  • "Some folders could not be created"
  • "Password requirements not met"
  • "Passwords do not match"

Version History

Version Date Changes
1.0.0 2026-01-02 Initial comprehensive guide

Admin Panel Guide: Navigate to Admin Panel → Help → Documentation

  • Storage Server Configuration: Navigate to Admin Panel → Tools → Storage Servers
  • Creator Platform Setup: Navigate to Admin Panel → Settings → Creators