⚙️ Configuration Guide

Complete configuration reference for Xiuno BBS 4.0.4

Configuration File Structure

The main configuration file is located at conf/conf.php. This file controls all core system settings.

File Location

/home/yourusername/public_html/conf/conf.php
⚠️ Important: Always backup conf.php before making changes. Set permissions to 600 for security.

Database Configuration

Basic Database Settings

'db' => array(
    'type' => 'mysql',              // Database type (only mysql supported)
    'host' => '127.0.0.1',          // Database host
    'port' => 3306,                 // MySQL port (default: 3306)
    'name' => 'xiuno',              // Database name
    'user' => 'xiuno',              // Database username
    'pass' => 'your_password',      // Database password
    'charset' => 'utf8mb4',         // Character set (utf8mb4 recommended)
    'engine' => 'MyISAM',           // Storage engine (MyISAM or InnoDB)
    'prefix' => 'bbs_',             // Table prefix
),

Database Options Explained

Option Description Recommended
charset Character encoding for database utf8mb4 (full Unicode support)
engine MySQL storage engine MyISAM (faster reads) or InnoDB (transactions)
prefix Table name prefix bbs_ (prevents conflicts)

Site Configuration

Basic Site Settings

'sitename' => 'Xiuno Wiki',
'sitebrief' => 'Documentation, Downloads & Community Knowledge Base',
'siteurl' => 'https://xiuno.wiki',
'sitedomain' => 'xiuno.wiki',
'sitelogo' => '/view/img/logo.png',

Language & Localization

'lang' => 'en-us',              // Language pack (en-us, zh-cn, etc.)
'timezone' => 'America/New_York', // Server timezone

Available languages:

Cache Configuration

Cache Types

Xiuno supports multiple cache backends:

1. MySQL Cache (Default)

'cache' => array(
    'type' => 'mysql',
),

2. Redis Cache (Recommended for High Traffic)

'cache' => array(
    'type' => 'redis',
    'host' => '127.0.0.1',
    'port' => 6379,
    'timeout' => 0,
    'prefix' => 'xiuno_',
),

3. Memcached

'cache' => array(
    'type' => 'memcached',
    'host' => '127.0.0.1',
    'port' => 11211,
),

4. File Cache

'cache' => array(
    'type' => 'file',
    'dir' => './tmp/cache/',
),
💡 Performance Tip: For sites with >1000 daily visitors, use Redis or Memcached for best performance.

Upload & Attachment Settings

File Upload Configuration

'upload' => array(
    'path' => './upload/',                  // Upload directory
    'url' => '/upload/',                    // Public URL path
    'max_size' => 2097152,                  // Max file size (2MB = 2097152 bytes)
    'allow_ext' => 'jpg,jpeg,png,gif,zip',  // Allowed extensions
),

Attachment Settings

Setting Value Description
Max Size 2097152 (2MB) Maximum upload size in bytes
Allowed Types Images, archives jpg, png, gif, zip, rar
Image Quality 85-95 JPEG compression quality

Email/SMTP Configuration

Configure email for user registration, notifications, and password resets:

'smtp' => array(
    'on' => 1,                              // Enable SMTP (1 = on, 0 = off)
    'host' => 'smtp.gmail.com',             // SMTP server
    'port' => 587,                          // SMTP port (587 for TLS, 465 for SSL)
    'user' => '[email protected]',         // SMTP username
    'pass' => 'your_app_password',          // SMTP password
    'from' => '[email protected]',         // From email address
    'fromname' => 'Xiuno Wiki',             // From name
    'secure' => 'tls',                      // Encryption (tls or ssl)
),

Popular SMTP Providers

Provider Host Port Secure
Gmail smtp.gmail.com 587 TLS
SendGrid smtp.sendgrid.net 587 TLS
Mailgun smtp.mailgun.org 587 TLS
Amazon SES email-smtp.region.amazonaws.com 587 TLS

Security Settings

Session Configuration

'session' => array(
    'name' => 'xiuno_session',
    'path' => './tmp/session/',
    'lifetime' => 86400,                    // 24 hours
    'cookie_lifetime' => 0,                 // 0 = until browser close
),

Security Options

'security' => array(
    'password_salt' => 'random_salt_here',  // Password encryption salt
    'ip_check' => 1,                        // IP address verification
    'user_agent_check' => 0,                // User agent verification
    'csrf_protection' => 1,                 // CSRF token protection
),
🔒 Security: Never share your password_salt. Generate a unique random string and keep it secret.

SEO & URL Settings

URL Rewriting

'url_rewrite_on' => 1,                      // Enable URL rewriting
'url_rewrite_ext' => '.html',               // Extension for pretty URLs

SEO Meta Tags

'seo_title' => 'Xiuno Wiki - Official Documentation',
'seo_keywords' => 'xiuno, bbs, forum, documentation',
'seo_description' => 'Official Xiuno BBS documentation and community',

Performance Tuning

Optimization Settings

'gzip_on' => 1,                             // Enable Gzip compression
'debug' => 0,                               // Debug mode (0 = off, 1 = on)
'runtime_cache' => 1,                       // Cache runtime data
'static_cache_time' => 86400,               // Static file cache (24 hours)
'page_cache_time' => 300,                   // Page cache (5 minutes)

Database Optimization

'db_persistent' => 0,                       // Persistent connections
'db_cache_on' => 1,                         // Query result caching
'db_slow_query_log' => 0,                   // Log slow queries

Registration & User Settings

User Registration

'register_on' => 1,                         // Allow registration
'register_email_on' => 1,                   // Require email verification
'register_captcha_on' => 1,                 // Enable CAPTCHA
'register_invite_on' => 0,                  // Invite-only registration

User Permissions

'user_reply_on' => 1,                       // Allow replies
'user_create_thread_on' => 1,               // Allow thread creation
'user_upload_on' => 1,                      // Allow file uploads
'guest_read_on' => 1,                       // Allow guest browsing

Advanced Configuration

API Settings

'api_on' => 1,                              // Enable API
'api_key' => 'your_secret_api_key',         // API authentication key
'api_rate_limit' => 100,                    // Requests per minute

Plugin System

'plugin_dir' => './plugin/',                // Plugin directory
'plugin_on' => 1,                           // Enable plugins

Complete Configuration Example

Here's a complete production-ready configuration:

<?php
return array(
    // Database
    'db' => array(
        'type' => 'mysql',
        'host' => '127.0.0.1',
        'port' => 3306,
        'name' => 'xiuno',
        'user' => 'xiuno',
        'pass' => 'strong_password_here',
        'charset' => 'utf8mb4',
        'engine' => 'MyISAM',
        'prefix' => 'bbs_',
    ),
    
    // Cache (Redis recommended)
    'cache' => array(
        'type' => 'redis',
        'host' => '127.0.0.1',
        'port' => 6379,
        'prefix' => 'xiuno_',
    ),
    
    // Site Info
    'sitename' => 'Xiuno Wiki',
    'sitebrief' => 'Documentation, Downloads & Community',
    'siteurl' => 'https://xiuno.wiki',
    'sitelogo' => '/view/img/logo.png',
    
    // Localization
    'lang' => 'en-us',
    'timezone' => 'America/New_York',
    
    // Security
    'password_salt' => 'random_unique_salt_here',
    'csrf_protection' => 1
,
    
    // SEO
    'url_rewrite_on' => 1,
    'url_rewrite_ext' => '.html',
    
    // Performance
    'gzip_on' => 1,
    'debug' => 0,
    'runtime_cache' => 1,
);
Next Steps: After configuring, visit the Admin Guide to set up your forum structure.