Getting Started
Installation guide for Multi Host covering prerequisites, initial setup, database configuration, and first steps after deployment.
This guide walks through installing Multi Host from initial download to a working deployment. Before beginning, ensure your hosting environment meets the requirements outlined in Hosting Requirements.
Prerequisites
Multi Host requires a web server with PHP and a MySQL-compatible database. The specific versions and extensions needed depend on which features you plan to use, but a typical installation needs:
- PHP 7.4 or later (PHP 8.x recommended for performance and security)
- MySQL 5.7+ or MariaDB 10.3+ for data storage
- GD or ImageMagick extension for thumbnail generation
- Write access to upload and cache directories
Your web server (Apache, Nginx, or similar) should be configured to process PHP files and serve static content. Most shared hosting environments meet these requirements by default.
For detailed server specifications including memory recommendations and optional extensions, see the hosting requirements documentation.
Download and Extraction
Obtain the installation package from your authorised source. The package contains the application files, database schema, and configuration templates.
Extract the archive to your web server's document root or a subdirectory, depending on whether Multi Host will serve your entire domain or a specific path. Common locations include:
/var/www/html/ # Serves as the domain root
/var/www/html/hosting/ # Serves from example.com/hosting/
/home/user/public_html/ # Common shared hosting path
After extraction, the directory structure includes:
├── admin/ # Administrative interface
├── includes/ # Core application code
├── uploads/ # Default upload storage (configurable)
├── cache/ # Thumbnail and temporary cache
├── config.php # Main configuration file
└── index.php # Application entry point
Set appropriate file permissions before proceeding. The web server needs read access to all files and write access to uploads/, cache/, and config.php during setup.
Database Setup
Create a database and user for the installation. Through your hosting control panel or command line:
CREATE DATABASE multihost CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'multihost'@'localhost' IDENTIFIED BY 'your-secure-password';
GRANT ALL PRIVILEGES ON multihost.* TO 'multihost'@'localhost';
FLUSH PRIVILEGES;
The utf8mb4 character set ensures proper handling of Unicode content including emoji. Using a dedicated database user limits exposure if credentials are compromised.
Import the database schema from the included SQL file:
mysql -u multihost -p multihost < install/schema.sql
This creates the necessary tables for users, uploads, settings, and other application data. The schema file includes default configuration values that you'll customise during setup.
Initial Configuration
Open config.php in a text editor. The file contains commented sections explaining each setting. Essential values to configure:
Database Connection
$config['db_host'] = 'localhost';
$config['db_name'] = 'multihost';
$config['db_user'] = 'multihost';
$config['db_pass'] = 'your-secure-password';
Use the credentials created during database setup. For most installations, localhost works correctly. Some hosting configurations require a specific hostname or socket path.
Site URLs
$config['site_url'] = 'https://example.com';
$config['site_path'] = '/';
Set site_url to your domain including the protocol. If installing in a subdirectory, adjust site_path accordingly (e.g., /hosting/).
Upload Settings
$config['upload_path'] = '/var/www/html/uploads/';
$config['max_upload_size'] = 10485760; // 10MB in bytes
$config['allowed_types'] = ['jpg', 'jpeg', 'png', 'gif', 'webp'];
The upload path should be an absolute filesystem path with write permissions. Consider placing uploads outside the document root for security, with a separate serving mechanism.
For comprehensive configuration options, see the Configuration Reference.
PHP Configuration
Some PHP settings may need adjustment through php.ini, .htaccess, or your hosting control panel:
upload_max_filesize = 20M
post_max_size = 25M
max_execution_time = 120
memory_limit = 256M
These values should accommodate your largest expected uploads plus processing overhead. The upload limit in PHP must be at least as large as the limit configured in Multi Host, or PHP will reject uploads before the application sees them.
The PHP manual covers file upload configuration in detail, including handling for different server environments.
Web Server Configuration
Apache
For Apache with mod_rewrite, the included .htaccess file handles URL routing. Ensure AllowOverride All is set for your directory in the Apache configuration.
If .htaccess files are disabled, add equivalent rules to your virtual host configuration:
<Directory /var/www/html>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Nginx
Nginx requires explicit configuration since it doesn't process .htaccess files:
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\. {
deny all;
}
Adjust the PHP-FPM socket path to match your installation.
Running the Installer
Navigate to your installation URL in a web browser. The setup wizard verifies requirements, tests database connectivity, and creates the administrator account.
Follow the wizard prompts to:
- Verify requirements - Confirms PHP version, extensions, and file permissions
- Test database - Validates connection using your configured credentials
- Create admin account - Sets up the initial administrator user
- Configure basic settings - Site name, timezone, and essential options
After completing the wizard, remove or rename the install/ directory to prevent re-running setup.
Post-Installation Steps
With the basic installation complete, several additional steps prepare the system for production use:
Secure Configuration Files
Remove write permissions from config.php after setup completes:
chmod 644 config.php
This prevents accidental or malicious modification through the web server.
Set Up Scheduled Tasks
Some features require periodic background processing. Add cron jobs for:
# Process pending thumbnail generation (every 5 minutes)
*/5 * * * * php /var/www/html/cron/thumbnails.php
# Clean expired temporary files (daily)
0 3 * * * php /var/www/html/cron/cleanup.php
# Update storage statistics (hourly)
0 * * * * php /var/www/html/cron/stats.php
Adjust paths and schedules to match your installation and requirements.
Configure Backups
Establish backup procedures covering both the database and uploaded files. The database stores user accounts, settings, and metadata. The upload directory contains the actual files.
For database backups:
mysqldump -u multihost -p multihost > backup-$(date +%Y%m%d).sql
For file backups, use rsync, tar, or your hosting provider's backup tools to capture the uploads directory.
Review Security Settings
Before opening the site to users, work through the Security Checklist. This covers essential protections for file uploads, access control, and server configuration.
Verification
Test the installation by:
- Logging into the admin panel with your created account
- Uploading a test image through the main interface
- Verifying the thumbnail generates correctly
- Checking that the image displays properly on its page
If any step fails, check the error logs (typically in logs/ or your server's error log location) for diagnostic information.
Frequently Asked Questions
Install the required PHP extensions through your hosting control panel or package manager. Common missing extensions include GD (for images), mbstring (for Unicode), and curl (for remote features). After installing, restart PHP-FPM or your web server.