Aller au contenu principal

⚡ LiteSpeed / OpenLiteSpeed

LiteSpeed is an excellent choice for Monitron SaaS — it's fast, efficient, and can read Apache .htaccess files natively, so setup is straightforward.


📋 Prerequis

  • LiteSpeed Web Server or OpenLiteSpeed
  • PHP 8.2+ (LSAPI)

🔧 Configuration

Option A: Using .htaccess (Easiest)

LiteSpeed reads Apache .htaccess files automatically! Monitron already includes a .htaccess file in public/, so:

  1. Set the Document Root to /var/www/monitron/public
  2. Enable rewrite in your virtual host settings
  3. That's it! 🎉

Option B: LiteSpeed Virtual Host Config

In your LiteSpeed admin panel (https://your-server:7080):

  1. Navigate to Virtual HostsAdd
  2. Fill in:
ParametreValeur
Virtual Host Namemonitron
Virtual Host Root/var/www/monitron/
Document Root$VH_ROOT/public/
Domain Nameyour-domain.com
  1. Under Rewrite tab:
    • Enable Rewrite: Yes
    • Rewrite Rules:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
  1. Under Security tab:
    • Block access to .env file:
    <FilesMatch "^\.env">
    Require all denied
    </FilesMatch>

🔒 SSL Setup

In the LiteSpeed admin panel:

  1. Navigate to ListenersAdd SSL Listener (or edit existing)
  2. Set port to 443
  3. Under SSL tab:
    • Private Key File: /etc/letsencrypt/live/your-domain.com/privkey.pem
    • Certificate File: /etc/letsencrypt/live/your-domain.com/fullchain.pem

🐘 PHP Configuration

LiteSpeed uses LSAPI for PHP which is very fast. In the admin panel:

  1. Navigate to Server ConfigurationExternal App
  2. Make sure your PHP 8.3 LSAPI app is configured
  3. Set Max Connections: 20
  4. Set Initial Request Timeout: 120 (for AI features)

✅ Verifier

After configuration, restart LiteSpeed:

# LiteSpeed Enterprise
sudo systemctl restart lsws

# OpenLiteSpeed
sudo systemctl restart lshttpd

Visit https://your-domain.com to verify.


💡 Conseils de Performance

LiteSpeed has several advantages for Monitron:

  • Built-in caching: Enable LSCache for static assets
  • HTTP/3 support: Enable QUIC for faster page loads
  • Efficient PHP handling: LSAPI is faster than PHP-FPM
  • Low memory usage: Great for VPS with limited RAM