Apache

Redirct all HTTP to HTTPS

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
  • or
<VirtualHost *:80>
  RedirectMatch ^/(.*)$ https://$SERVER_HOST/$1
</VirtualHost>

New allow all

<Location "/content/">
    AllowOverride All
    Require all granted
</Location>

Run in foreground

LogLevel info
ErrorLog "|cat"
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog "|cat" common

Serve Django or WSGI app

  • install mod_wsgi
<VirtualHost *:80>
    ServerName my-cool-webserver

    WSGIDaemonProcess $APPNAME user=$UNIX_USER group=$UNIX_GROUP threads=42
    WSGIScriptAlias / /path/to/run.wsgi

    <Directory /path/to/app/>
        WSGIProcessGroup $UNIX_GROUP
        WSGIApplicationGroup %{GLOBAL}
    </Directory>

</VirtualHost>