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.

+3
source share
5 answers

It is better to create mod_wsgi yourself from the code, rather than using an arbitrary binary file from the network. The steps are as follows.

  • Make sure you have a decent Apache installation that includes header files, such as Apache 2.4.37 Win64 from Apache Lounge . It is preferably installed in the C: /Apache24 .

  • Make sure your Python installation is configured so that you can install pip modules. This should include the correct Microsoft C compiler required for this version of Python.

  • Run pip install mod_wsgi . If your Apache installation is not in C: /Apache24 , first set the MOD_WSGI_APACHE_ROOTDIR environment variable for MOD_WSGI_APACHE_ROOTDIR . Make sure you specify the path in the form C: /Apache24 and not with a backslash, that is, not like C:\Apache24 . This is only necessary during installation, and not later.

  • Run mod_wsgi-express module-config .

  • Copy the output from mod_wsgi-express module-config to the Apache configuration file.

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

  • Restart Apache and see if it works.

Note that you'd better start with the WSGI hello world, and not with some huge Django app during initial testing.

+4
source
 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][2] There is a step by step guidance available [here][3] [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 
+2
source

Use the Apache Lounge edition if you still find c:\apache24\include\apr_network_io.h(29) : fatal error C1083: Cannot open include file: 'apr_perms_set.h': No such file or directory'. . This is best suited for Windows.

+2
source

@LarryMartell I met the same problem on windows and fixed it. You can try copying the apr_perms_set.h file from the apr repository ( https://github.com/traviscross/apr ) to the Apache2.4 include folder.

+1
source

I am using a 64-bit operating system and I have 64-bit Python installed.

installing the Apache distribution for the 64-bit OS from apachelounge https://www.apachelounge.com/download/ solved the problem for me.

+1
source

Source: https://habr.com/ru/post/1264409/


All Articles