2016-04-18 11 views
0

私は、fastcgiを使って私のフラスコのアプリケーションをApacheにデプロイしようとしています。WindowsでfastcgiとApacheを使ってフラスコを展開する

OS:Windowsの10 のpython 2.7

apacheのパス:E:開発\ \ Webサービス\ Apacheの\ビン\ httpd.exe

Pythonのパス:C:\ Python27 \ python.exe

私はFastCGIのを実行するためのMOD mod_fcgid 2.3.9を使用しています(Eを:開発\ \ Webサービス\ apacheの\モジュール\ mod_fcgid.so)

私のFastCGI confに(E:開発\ \ Webサービス\のapache \ confに\エクストラ\ httpd-fastcgi.conf)

FcgidInitialEnv PATH "e:/development/webservices/php;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;C:/Python27/;C:/Python27/Scripts;" 
FcgidInitialEnv SystemRoot "C:/Windows" 
FcgidInitialEnv SystemDrive "C:" 
FcgidInitialEnv TEMP "C:/WINDOWS/Temp" 
FcgidInitialEnv TMP "C:/WINDOWS/Temp" 
FcgidInitialEnv windir "C:/WINDOWS" 
FcgidIOTimeout 64 
FcgidConnectTimeout 16 
FcgidMaxRequestsPerProcess 1000 
FcgidMaxProcesses 50 
FcgidMaxRequestLen 8131072 
# Location php.ini: 
FcgidInitialEnv PHPRC "e:/development/webservices/php" 
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000 

<Files ~ "\.php$>" 
    AddHandler fcgid-script .php 
    FcgidWrapper "e:/development/webservices/php/php-cgi.exe" .php 
</Files> 

私のhttpd.conf:

Listen 5000 
LoadModule fcgid_module modules/mod_fcgid.so 
# FastCGI 
Include conf/extra/httpd-fastcgi.conf 
# Virtual hosts 
Include conf/extra/httpd-vhosts.conf 

私のhttpd-vhosts.conf:

<VirtualHost *:5000> 
    ServerName localhost:5000 
    DocumentRoot c:/myproject/app 
    ScriptAlias/c:/myproject/app/runserver.fcgi/ 

<Directory "c:/myproject/app/"> 
    AllowOverride None 
    Allow from all 
    Options +ExecCGI 
    AddHandler fcgid-script .fcgi 
    Require all granted 
</Directory> 

</VirtualHost> 

マイフラスコのアプリケーションはここにある:C:\ MyProjectと\アプリ

それは持っています以下の構造:

app\ 
    runserver.py 
    runserver.fcgi 
    gallery\ 
    image_hosting\ 
        images\ 
        static\ 
          css\ 
          jmg\ 
          js\ 
        templates\ 
        init.py 
        forms.py 
        models.py 
        routes.py 

runserver.fcgi内容:

#!C:/Python27/python.exe 
# -*- coding: utf-8 -*- 
import os 
from flup.server.fcgi import WSGIServer 
from image_hosting import app 

if __name__ == '__main__': 
    WSGIServer(app).run() 

私はlocalhostとアセスしよう:5000私は

Apacheのエラーログ500内部サーバーエラーを取得:

AH00558: httpd.exe: Could not reliably determine the server's fully qualified domain name, using fe80::680d:ad2a:63e8:99bd. Set the 'ServerName' directive globally to suppress this message 
[Mon Apr 18 12:36:20.405465 2016] [mpm_winnt:notice] [pid 20032:tid 668] AH00455: Apache/2.4.20 (Win64) mod_fcgid/2.3.9 configured -- resuming normal operations 
[Mon Apr 18 12:36:20.405465 2016] [mpm_winnt:notice] [pid 20032:tid 668] AH00456: Apache Lounge VC14 Server built: Apr 5 2016 13:15:28 
[Mon Apr 18 12:36:20.405465 2016] [core:notice] [pid 20032:tid 668] AH00094: Command line: 'E:\\development\\webservices\\apache\\bin\\httpd.exe -d E:/development/webservices/apache' 
[Mon Apr 18 12:36:20.406460 2016] [mpm_winnt:notice] [pid 20032:tid 668] AH00418: Parent: Created child process 3788 
AH00558: httpd.exe: Could not reliably determine the server's fully qualified domain name, using fe80::680d:ad2a:63e8:99bd. Set the 'ServerName' directive globally to suppress this message 
AH00558: httpd.exe: Could not reliably determine the server's fully qualified domain name, using fe80::680d:ad2a:63e8:99bd. Set the 'ServerName' directive globally to suppress this message 
[Mon Apr 18 12:36:20.702847 2016] [mpm_winnt:notice] [pid 3788:tid 648] AH00354: Child: Starting 64 worker threads. 
[Mon Apr 18 12:36:21.444860 2016] [mpm_winnt:notice] [pid 7552:tid 652] AH00364: Child: All worker threads have exited. 
[Mon Apr 18 12:36:28.178274 2016] [fcgid:warn] [pid 3788:tid 1172] (OS 109)The pipe has been ended. : [client ::1:56818] mod_fcgid: get overlap result error 
[Mon Apr 18 12:36:28.178274 2016] [core:error] [pid 3788:tid 1172] [client ::1:56818] End of script output before headers: runserver.fcgi 

誰かが、私に説明することができます問題と思われるものはどうすれば解決できますか?

答えて

0

明らかに、flupはWindowsをサポートしていません。それは私には本当に馬鹿だった。

関連する問題