🟠 Apache
Apache is one of the most widely used web servers. Monitron SaaS works perfectly with Apache 2.4+ when configured correctly.
📋 Предварительные требования
- Apache 2.4+ installed
mod_rewriteenabledmod_sslenabled (for HTTPS)- PHP 8.2+ as mod_php or via PHP-FPM
🔧 Enable Required Modules
sudo a2enmod rewrite
sudo a2enmod ssl
sudo a2enmod headers
sudo systemctl restart apache2
📝 VirtualHost Configuration
Create a new VirtualHost:
sudo nano /etc/apache2/sites-available/monitron.conf
Paste this configuration:
<VirtualHost *:80>
ServerName your-domain.com
Redirect permanent / https://your-domain.com/
</VirtualHost>
<VirtualHost *:443>
ServerName your-domain.com
# ─── Document Root ────────────────────────────────────
# 🚨 IMPORTANT: Point to the /public directory!
DocumentRoot /var/www/monitron/public
# ─── SSL Configuration ────────────────────────────────
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/your-domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/your-domain.com/privkey.pem
# ─── Directory Settings ───────────────────────────────
<Directory /var/www/monitron/public>
AllowOverride All
Require all granted
Options -Indexes +FollowSymLinks
# Laravel URL rewriting
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
</Directory>
# ─── Block Access to Sensitive Files ──────────────────
<FilesMatch "^\.env">
Require all denied
</FilesMatch>
# ─── Security Headers ─────────────────────────────────
Header always set X-Frame-Options "SAMEORIGIN"
Header always set X-Content-Type-Options "nosniff"
Header always set X-XSS-Protection "1; mode=block"
Header always set Referrer-Policy "strict-origin-when-cross-origin"
# ─── Logging ──────────────────────────────────────────
ErrorLog ${APACHE_LOG_DIR}/monitron-error.log
CustomLog ${APACHE_LOG_DIR}/monitron-access.log combined
# ─── PHP Timeout for AI requests ─────────────────────
<IfModule mod_php.c>
php_value max_execution_time 120
php_value upload_max_filesize 100M
php_value post_max_size 100M
</IfModule>
</VirtualHost>