Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

django - How to install mod_wsgi for apache 2.4 and python 3.4 on windows?

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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, e.g. Apache 2.4.37 Win64 from Apache Lounge . 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...