您的位置:首页 > 运维架构 > Apache

Flask + mod_wsgi + Apache on Windows 部署成功

2016-12-18 00:00 447 查看
废话不多说,直接开始 。

背景:身为QA人员 一直想把工作一系列的方便测试的高效的方法与脚本分享给其余的QA人员,但是无奈与水平参差不齐,为了更好的服务与QA人员 ,最近在写一个QA管理

系统,使用的是 flask ,但是由于环境的限制不能部署到Linux 系统 (主要是懒不想搞环境) ,决定在window上进行部署 。

方法 : 百度 搜索到此文章 ,http://blog.csdn.net/firefox1/article/details/46438769 。(方法主要来源此)

版本:win 64 , Python 2.7 64 , mod_wsgi 64 , Apache 64

工具:Python + flask + mod_wsgi + Apache

工具下载路径 (如果是64位 ) : 只提供 mod_wsgi + Apache (http://pan.baidu.com/s/1gePLHJX) (非64位的,参考 步骤方法中的 链接)

参考这个 文章 主要遇到的问题 : http://blog.csdn.net/firefox1/article/details/46438769

You don't have permission to access /flasktest/hello on this server.You don't have permission to access /flasktest/hello on this server.

修改方法 :

1. 进入 Apache 的 conf/httpd.conf 配置文件 修改文件访问权限:

<Directory />
AllowOverride none
Require all denied
</Directory>

修改为:

<Directory />
#AllowOverride none
#Require all denied
</Directory>

对于原文章中的站点 virtualhost 配置 最好不要在 httpd.conf 中配置 ,Apache 有 httpd-vhosts.conf 配置文件,

具体配置方法 :

<VirtualHost *:80 >
ServerAdmin example@company.com
DocumentRoot D:\work\QA
<Directory "D:\work\QA">
Order allow,deny
Allow from all
</Directory>
WSGIScriptAlias /qa D:\work\QA\QA.wsgi
</VirtualHost>

Copy 到 conf/extra/httpd-vhosts.conf 并且 在把 httpd.conf 中如下配置的注释去掉:

# Virtual hosts
Include conf/extra/httpd-vhosts.conf



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  flask mod_wsgi Apa