首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >windows中带有FastCGI和lighttpd的FastCGI

windows中带有FastCGI和lighttpd的FastCGI
EN

Stack Overflow用户
提问于 2016-07-19 18:53:41
回答 1查看 660关注 0票数 0

我正试图在python2.7中使我的web.py应用程序达到生产级别,如本文档windows环境中所描述的那样。所以我把

生产-> LightTPD -> ..。用FastCGI

节在上面的页中。首先安装flup,然后添加

代码语言:javascript
复制
#!/usr/bin/env python

给我的Code.py

然后我从这里下载了lighttpd,并提取了Lightttpd-1.4.39-1-IPv 6-Win32-SSL.zip。

接下来,我编辑了文档中提到的lighttpd.conf。由于我使用Windows,所以我使用了完整的路径来使其工作,如下所示。

代码语言:javascript
复制
server.modules = ("mod_fastcgi", "mod_rewrite")
server.document-root = "C:\Python27\New folder\LightTPD-1.4.39-1-IPv6-Win32-SSL\LightTPD\htdocs\Engine" 
fastcgi.server = ( "\Code.py" =>     
 (( "socket" => "C:\Python27\New folder\LightTPD-1.4.39-1-IPv6-Win32-SSL\LightTPD\htdocs\Engine\tmp\fastcgi.socket",
    "bin-path" => "C:\Python27\New folder\LightTPD-1.4.39-1-IPv6-Win32-SSL\LightTPD\htdocs\Engine\Code.py",
    "max-procs" => 1
 ))
 )
url.rewrite-once = (
   "^/favicon.ico$" => "/static/favicon.ico",
   "^/static/(.*)$" => "/static/$1",
   "^/(.*)$" => "/Code.py/$1"
 )

这是我的Code.py

代码语言:javascript
复制
#!/usr/bin/env python 
__author__ = 'Marlon'
import web
import json
import time

urls = (
    '/foo(.*)', 'Foo'
)
class Foo(web.storage):

    def GET(self,r):
        web.header('Access-Control-Allow-Origin',      '*')
        web.header('Access-Control-Allow-Credentials', 'true')
        result = time.sleep(30)
        return result

if __name__ == "__main__":
    app = web.application(urls, globals())
    app.run()

当我试图从命令提示符运行LightTPD.exe时,它会给出这个错误。

代码语言:javascript
复制
2016-07-20 00:02:23: (server.c.645) trying to read configuration (test mode)
2016-07-20 00:02:23: (log.c.194) server started
2016-07-20 00:02:23: (mod_fastcgi.c.1102) the fastcgi-backend C:\Python27\New folder\LightTPD-1.4.39-1-IPv6-Win32-SSL\LightTPD\htdoc\Engine\Code.py failed to start:
2016-07-20 00:02:23: (mod_fastcgi.c.1106) child exited with status 2 C:\Python27\New folder\LightTPD-1.4.39-1-IPv6-Win32-SSL\LightTPD\htdoc\Engine\Code.py
2016-07-20 00:02:23: (mod_fastcgi.c.1109) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.\nIf this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2016-07-20 00:02:23: (mod_fastcgi.c.1395) [ERROR]: spawning fcgi failed.
2016-07-20 00:02:23: (server.c.1057) Configuration of plugins failed. Going down

我需要安装任何与FastCGI相关的设备吗?我遇到过,它要求安装,但这并不适用于windows。我是否需要单独安装这个窗口,如果是的话,我可以在哪里得到它?是上述错误出现的问题吗?

EN

回答 1

Stack Overflow用户

发布于 2016-07-20 05:44:03

请试用本周早些时候发布的lighttpd 1.4.40。与以前的版本相比,它在Windows上运行得更好。您需要一个cygwin环境来从源代码构建它,但是可执行文件可以在cygwin环境之外运行。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38466392

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档