digitalfabrik/integreat-cms

View on GitHub
example-configs/apache2-integreat-vhost.conf

Summary

Maintainability
Test Coverage
<VirtualHost *:80>
        DocumentRoot /var/www/html/
        ServerName example.com
        RewriteEngine on
        RewriteCond %{REQUEST_URI} !^\/\.well-known\/
        RewriteRule (.*) https://%{SERVER_NAME}$1 [L,R=301]
</VirtualHost>

<VirtualHost *:443>
        ServerName example.com:443
        DocumentRoot /var/www/html
        SSLEngine On
        SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
        SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem

        <Directory /opt/integreat-cms/>
                <Files wsgi.py>
                        Require all granted
                </Files>
        </Directory>

        Alias /media/ /var/www/integreat-cms/media/
        Alias /static/ /var/www/integreat-cms/static/
        Alias /xliff/ /var/www/integreat-cms/xliff/download/

        # Configure the number of Django processes
        WSGIDaemonProcess example.com processes=8 threads=1 python-home=/opt/integreat-cms/.venv/
        WSGIProcessGroup example.com
        WSGIScriptAlias / /opt/integreat-cms/wsgi.py

        RewriteEngine On
        # Ping response for app online check
        RewriteRule "^ping$" - [R=204]

        CustomLog /var/log/apache2/access.log vhost_combined
</VirtualHost>