Flask + mod_wsgi + Apache on Windows 部署成功

廢話很少說,直接開始 。python

背景:身爲QA人員 一直想把工做一系列的方便測試的高效的方法與腳本分享給其他的QA人員,可是無奈與水平良莠不齊,爲了更好的服務與QA人員 ,最近在寫一個QA管理linux

系統,使用的是 flask ,可是因爲環境的限制不能部署到Linux 系統 (主要是懶不想搞環境) ,決定在window上進行部署 。flask

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

版本: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位的,參考 步驟方法中的 連接)ui

參考這個 文章 主要遇到的問題 : http://blog.csdn.net/firefox1/article/details/46438769this

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

修改方法 : firefox

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

相關文章
相關標籤/搜索