如何在Windows上安装apache 2.4和python 3.4的mod_wsgi? [英] How to install mod_wsgi for apache 2.4 and python 3.4 on windows?

查看:817
本文介绍了如何在Windows上安装apache 2.4和python 3.4的mod_wsgi?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有apache 2.4已经安装xampp.I尝试添加mod_wsgi使用上述步骤 here



但是当我添加行

  LoadModule wsgi_module modules / mod_wsgi-py34-vc10.so 


$ b $

解决方案

最好从代码自己构建mod_wsgi,而不是使用任意的二进制文件互联网。步骤如下。




  • 确保您具有包含头文件的正常的Apache安装。最好安装在 C:/ Apache24 的位置。


  • 确保您的Python安装设置为您可以 pip 安装模块。这必须包括该Python版本需要正确的Microsoft C编译器。


  • 运行 pip install mod_wsgi 。如果您的Apache安装不在 C:/ Apache24 ,那么首先将环境变量 MOD_WSGI_APACHE_ROOTDIR 设置到其位置。确保您将路径指定为 C:/ Apache24 表单,而不是以斜杠指定,也就是说,不如 C:\Apache24


  • 运行 mod_wsgi-express module-config


  • 将运行 mod_wsgi-express module-config 的输出复制到您的Apache配置文件中。 / p>


  • 将WSGI应用程序的配置添加到Apache配置。


  • 重新启动Apache并查看如果它有效。




请注意,您最好从WSGI hello世界开始,而不是一些巨大的Django应用程序初步测试。


I had apache 2.4 already installed with xampp.I tried adding mod_wsgi using the steps mentioned here

But when I add the line

LoadModule wsgi_module modules/mod_wsgi-py34-vc10.so

Apache does not start.

解决方案

It is better to build mod_wsgi yourself from code rather than use an arbitrary binary off the net. The steps are as follows.

  • Ensure you have a decent Apache installation which includes header files. Preferably installed at location of C:/Apache24.

  • Ensure your Python installation is set up so that you can pip install modules. This must include having the correct Microsoft C compiler needed by that Python version.

  • Run pip install mod_wsgi. If your Apache installation is not at C:/Apache24, then first set the environment variable MOD_WSGI_APACHE_ROOTDIR to its location. Ensure you specify path as C:/Apache24 form and not with back slashes, that is, not as C:\Apache24. This is only needed when doing the install, not later.

  • Run mod_wsgi-express module-config.

  • Copy the output from runing mod_wsgi-express module-config into your Apache configuration file.

  • Add configuration for a WSGI application to the Apache configuration.

  • Restart Apache and see if it works.

Note that you are better off starting with a WSGI hello world rather than some huge Django application when initially testing.

这篇关于如何在Windows上安装apache 2.4和python 3.4的mod_wsgi?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆