-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Python REST service started with commands:
export FLASK_APP=knowledgeTreeJsonRestService.py
nohup flask run --host=0.0.0.0 &
This works for a while and responds to REST requests, but stops responding after a few hours.
Needed: a mod_wsgi daemon process.
Method:
[(ref)](: http://www.datasciencebytes.com/bytes/2015/02/24/running-a-flask-app-on-aws-ec2/)
- Create knowledgetree.wsgi
import sys
sys.path.insert(0, '/var/www/html/knowledgetree')
from application import app as application
- Add directive to /etc/apache2/sites-enabled/000-default.conf
WSGIDaemonProcess knowledgetree threads=5
WSGIScriptAlias /knowledgetree /var/www/html/knowledgetree/knowledgetree.wsgi
WSGIPassAuthorization On
<Directory knowledgetree>
WSGIProcessGroup knowledgetree
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
- create symlink
sudo ln -sT ~/knowledgetree/var/www/html/knowledgetree - Restart apache.
sudo apachectl restart
Problem: works for urls where no login is required. But application contains @auth.login required for most endpoints.
Behaviour: Apache repeatedly asks for credentials and does not pass it on to the Python application. It should have passed on the credentials to the app since we have WSGIPassAuthorization On
Thus the WSGI process does not work for our purposes.
Metadata
Metadata
Assignees
Labels
No labels