【问题标题】:XAMPP + mod_wsgi + python Windows 7XAMPP + mod_wsgi + python Windows 7
【发布时间】:2013-02-27 09:55:40
【问题描述】:

我正在尝试在本地测试服务器上安装 django [我知道 python+django 有一个],并且我已经设置了 xampp 托管:

Apache 2.4,Python 2.7,mod_wsgi(从源代码编译:https://code.google.com/p/modwsgi/wiki/InstallationOnWindows 并使用 win32-ap22py27.mk,如果我使用的 make 文件没问题,则 idk 因为在启动 apache 时没有错误,并且 apache 说它加载了 wsgi模块以及我的python)

wsgi.conf [包含在 httpd.conf 中]:

WSGIScriptAlias /wsgi "C:/xampp/htdocs/wsgi/scripts/test.wsgi"
AddHandler wsgi-script .wsgi

<Directory "C:/xampp/htdocs/wsgi/scripts">
    Order deny,allow
    Allow from all
</Directory>

和一个通用的 test.wsgi 文件:

def application(env, start_response):
    start_response("200 OK", [])
    output = "<html>Hello World! Request: %s</html>"
    output %= env['PATH_INFO']
    return [output]

我的问题是在测试 wsgi 应用程序时连接中断:**http://localhost/wsgi**

我已经搜索了互联网,但没有运气

【问题讨论】:

    标签: python django apache xampp mod-wsgi


    【解决方案1】:

    好的,make 文件和模块肯定有问题 如果有人感兴趣的话,在这里(收藏这个东西):

    http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi

    使用 apache2.4 和 python2.7 兼容的 mod_wsgi3.4 现在它可以工作了......

    【讨论】:

      【解决方案2】:
      This topic is useful for Windows 10, xampp webserver as well.
      I was struggling to find precompiled mod_wsgi.so for 
      Apache/2.4.27 (Win32) 
      Python/2.7.13 
      This [link][1] is useful to find the appropriate version of mod_wsgi.
      IF you are lucky, you can find the precompiled version [here][1]
      There is a step by step guidance available [here][1]
      
          enter code here
      
        [1]: https://github.com/GrahamDumpleton/mod_wsgi/blob/develop/win32/README.rst
        [2]: http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi
        [3]: https://everything2.com/title/Installing+Python+on+XAMPP
      

      【讨论】:

      • 推荐的方法是通过运行pip install mod_wsgi自己构建它。参见 mod_wsgi 的 PyPi 页面。
      猜你喜欢
      • 2013-04-01
      • 2019-05-19
      • 2012-08-15
      • 1970-01-01
      • 2017-04-23
      • 1970-01-01
      • 2011-12-01
      • 2011-04-21
      • 2013-09-14
      相关资源
      最近更新 更多