【34】apache配置flask网站
2019-11-03 本文已影响0人
业余玩家
系统:centos
Apache:2.4.6
安装mod_wsgi
mod_wsgi软件包实现了一个易于使用的Apache模块,该模块可以托管任何支持Python WSGI 规范的Python Web应用程序。
yum install mod_wsgi
创建manage.wsgi
我们需要创建一个*.wsgi文件,该文件非常简单,仅仅是为了创建可被mod_wsgi调用的application。
import sys
sys.path.insert(0,"/var/www/html/find")
from manage import app as application
配置httpd.conf文件
<VirtualHost *:80>
ServerAdmin root@http.cn
DocumentRoot /var/www/html/find
ServerName localhost:8080
ErrorLog logs/error_log
CustomLog logs/access_log common
WSGIScriptAlias / /var/www/html/find/manage.wsgi
</VirtualHost>