Server Provisioning (install_server.sh)
Overview
Pragma CMS is designed to run on high-performance VPS environments. To eliminate server configuration errors, the core includes a complete, idempotent bash provisioner for Ubuntu/Debian.
Instead of relying on heavy Docker containers that add virtualization overhead, this script natively configures the exact stack required for maximum bare-metal performance.
Execution
Run this script as root on a fresh Ubuntu/Debian server:
BASH
sudo bash /path/to/pragma-cms/scripts/setup/install_server.sh
What the Script Does Under the Hood
- APT Optimization: Waits for background system updates to finish to prevent APT lock errors.
- Web Server (Caddy): Installs Caddy Server and configures the
Caddyfilewith On-Demand TLS. This allows Pragma CMS to automatically generate SSL certificates for new client domains on the fly without restarting the server. - PHP-FPM Optimization: Installs PHP (8.4+) and strictly overrides
php.inivia a99-pragma.inifile. It enforces a highly aggressive OPcache configuration (opcache.enable=1,opcache.memory_consumption=256,opcache.max_accelerated_files=20000). - Database (MariaDB): Installs MariaDB, creates the master database (
pragma_cms_platform), the staging database, and apragma_mastersuper-user. - Magic Permissions (ACLs): Uses
setfaclto allow both the Web Server (www-data) and the SSH user to read/write files seamlessly withoutchmod 777security risks. - Security Hardening:
- Modifies
/etc/ssh/sshd_configto change the default SSH port, disable Root login, and disable Password authentication. - Installs and configures Fail2Ban for SSH.
- Enables UFW (Uncomplicated Firewall), allowing only HTTP(80), HTTPS(443), and the custom SSH port.
- Modifies
- Cron Registration: Automatically injects
backup.shandcheck_updates.phpinto the system Crontab.