# apt-get install python-setuptools
# easy_install pip
# cd /var/www
# git clone https://github.com/salimane/flask-mvc.git
# cd flask-mvc
# pip install -r requirements.txt
# vi application.wsgi
import sys# apt-get install libapache2-mod-wsgi
sys.path.insert(0,'/var/www/flask-mvc')
from project import app as application
# vi /etc/apache2/sites-enabled/000-default.conf
WSGIDaemonProcess flaskapp user=www-data group=www-data threads=5# /etc/init.d/apache2 restart
WSGIScriptAlias /flask-mvc /var/www/flask-mvc/application.wsgi
WSGIProcessGroup flaskapp
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
http://0.0.0.0/flask-mvc
CentOS :
# yum install python-setuptools
# easy_install pip
# cd /var/www/html
# git clone https://github.com/salimane/flask-mvc.git
# cd flask-mvc
# pip install -r requirements.txt
# vi application.wsgi
import sys# yum install mod_wsgi
sys.path.insert(0,'/var/www/html/flask-mvc')
from project import app as application
# vi /etc/httpd/conf/httpd.conf
WSGIDaemonProcess flaskapp user=www-data group=www-data threads=5
WSGISocketPrefix run/wsgi
WSGIScriptAlias /flask-mvc /var/www/html/flask-mvc/application.wsgi
WSGIProcessGroup flaskapp
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
# /etc/init.d/httpd restart
References :
mod_wsgi (Apache) — Flask 0.11-dev documentation
Deploying Flask Apps with Apache and Mod WSGI - Informatics Bridging Team - Ocean Imaging Informatics @ WHOI
沒有留言:
張貼留言