Apache VHost Templates

Customize your Apache configuration

📝 VHost Templates

Customize your Apache configuration with per-project templates.

How Templates Work

  • Each project can have its own custom VHost template
  • Templates are stored per project name (not hostname)
  • Templates survive hostname changes
  • Use Jinja2 syntax for variables like {{ hostname }}

Available Variables

  • {{ hostname }} - Primary domain name
  • {{ document_root }} - Web root directory
  • {{ project_path }} - Full project path
  • {{ server_aliases }} - Additional domains
  • {{ php_fpm_socket }} - PHP-FPM socket path

Editing Templates

  1. Click "Edit VHost Template" on your project
  2. Modify the Apache configuration
  3. Click Save
  4. Click "Create VHost" or "Setup SSL" to apply

Common Customizations

  • Adding custom redirects
  • Setting environment variables
  • Configuring proxy rules
  • Adding security headers
  • Custom error pages

Template Inheritance

Templates are applied in this order:

  1. Base template (HTTP or HTTPS)
  2. Project-specific customizations
  3. SSL configuration (if enabled)
⚠️ Reset to Default

If you want to get the latest default template with new features, click "Reset to Default" in the Edit Template modal. Your customizations will be lost!

💡 Syntax Validation

Before applying, the system runs Apache configtest to validate your configuration. If there's an error, you'll see the message and the change won't be applied.