cavin dot name Fractals, Arts, Programming & Rambles

Installation & Deployment Guide

There is no installer wizard or database setup. Deploying CSE_CMS v2 takes only a few minutes over FTP.

Server Requirements

  • PHP 8.2 or newer (tested through PHP 8.5+)
  • Apache with mod_rewrite enabled (for clean URLs and internal file protection)
  • PHP GD extension (optional — only needed if you want automatic thumbnail generation for picture galleries)

Deploying to Your Web Host (FTP)

  1. Upload the CMS files to your target directory (either the web root or a subdirectory such as /mysite/):
    • index.php, .htaccess, config.php, users.php
    • src/, templates/, themes/, assets/
    • Your language folders (en/, fr/, de/, ...) plus media/, plugin/, comments/, and stats/
    • Tip: Make sure your FTP client shows hidden files so .htaccess is uploaded! Do not upload local development helpers like router.php or backup folders.
  2. Edit config.php:
    • Set your default language (default_lang), default layout (default_template), default visual theme (default_theme), and site titles/texts under i18n.
    • Set a unique random string for antispam.secret_key (used to sign anti-spam tokens and hash rate-limit keys).
    • Leave base_url empty ('') so CSE_CMS v2 automatically detects HTTP/HTTPS, domain, and subdirectory.
  3. Configure users.php (only needed if you use CSE_lock private folders or CSE_phpinfo):
    • Generate a secure bcrypt password hash on the command line:
      php -r 'echo password_hash("your-strong-password", PASSWORD_DEFAULT) . PHP_EOL;'
    • Add your user entry with password_hash, all_access (true/false), groups (array of numeric group IDs matching your CSE_lock files), and phpinfo (true/false).
  4. Check write permissions:
    • Ensure PHP can write to stats/ (for monthly JSON statistics), comments/ (if inline comments are enabled), and plugin/*/data/ (if using plugins that store data).
  5. Verify .htaccess protection:
    • Visit /en/ (or your default language) — the site should load with styles and navigation.
    • Confirm that requesting /config.php, /users.php, or /stats/ directly in your browser returns 403 Forbidden.

Subdirectory & Root Redirects

CSE_CMS v2 works identically at the domain root (/) or inside any subdirectory (/CSE2/). If installed in a subdirectory and you want the bare domain root to redirect to it, place a minimal .htaccess in the parent root:

RewriteEngine On
DirectoryIndex index.php index.html index.htm
RewriteRule ^$ /your-subfolder/en/ [R=301,L]

Testing Locally on Your Computer

PHP's built-in web server does not read .htaccess, so CSE_CMS v2 includes a local router.php strictly for development:

php -S localhost:8080 router.php

Open http://localhost:8080/en/ in your browser to preview changes before uploading via FTP.