Skip to content

Instantly share code, notes, and snippets.

@craigderington
Created September 7, 2022 23:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save craigderington/f9abbc4485441e9279c397ce6a38988c to your computer and use it in GitHub Desktop.
Save craigderington/f9abbc4485441e9279c397ce6a38988c to your computer and use it in GitHub Desktop.
Flask App WSGI Apache Configuration
<VirtualHost *:80>
# listen for non-www, redirect to non-www
ServerName domainname.com
Redirect permanent / http://www.domainname.com
</VirtualHost>
<VirtualHost *:80>
ServerName www.domainname.com
ServerAdmin alias@domainame.com
DocumentRoot /var/www/html/sitename
WSGIDaemonProcess sitename user=ubuntu group=www-data threads=5
WSGIScriptAlias / /var/www/html/sitename/wsgi.py
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html/geoip>
WSGIProcessGroup sitename
WSGIApplicationGroup %{GLOBAL}
Require all granted
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment