如何在Windows上安装apache 2.4和python 3.4的mod_wsgi? [英] How to install mod_wsgi for apache 2.4 and python 3.4 on windows?
问题描述
但是当我添加行
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 atC:/Apache24
, then first set the environment variableMOD_WSGI_APACHE_ROOTDIR
to its location. Ensure you specify path asC:/Apache24
form and not with back slashes, that is, not asC:\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屋!