Skip to content

Instantly share code, notes, and snippets.

@prochor666
Last active April 18, 2022 03:34
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prochor666/a367a9ebd7cf67f04668 to your computer and use it in GitHub Desktop.
Save prochor666/a367a9ebd7cf67f04668 to your computer and use it in GitHub Desktop.
Create & run python/wsgi app on Ispconfig 3 / Debian
#!/bin/bash
# place thi s file into the web dir
# install Flask foundation + dependencies
cd ..
git clone https://github.com/JackStouffer/Flask-Foundation.git web
cd web
make deps
wget https://gist.github.com/prochor666/a367a9ebd7cf67f04668/raw/6516a8dd3c90c808c5f2c81f67481a4fd48126f6/manage.wsgi
# webXX - replace with ispconfig user
# clientXX - replace with ispconfig group
WSGIDaemonProcess webXX user=webXX group=clientXX threads=5
<Directory /var/www/clients/clientXX/webXX/web/>
WSGIProcessGroup webXX
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Options +ExecCGI
Allow from all
</Directory>
WSGIScriptAlias / /var/www/clients/clientXX/webXX/web/manage.wsgi
import os
import sys
from os import path as op
APPROOT = op.abspath(op.dirname(__file__))
if not APPROOT in sys.path:
sys.path.insert(0, APPROOT)
from appname import create_app
env = os.environ.get('APPNAME_ENV', 'dev')
application = create_app('appname.settings.%sConfig' % env.capitalize(), env=env)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment