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

前端 未结 5 1073
野的像风
野的像风 2020-12-03 16:09

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          


        
相关标签:
5条回答
  • 2020-12-03 16:36

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

    installing apache distribution for 64 bit OS from apachelounge https://www.apachelounge.com/download/ resolved the problem for me.

    0 讨论(0)
  • 2020-12-03 16:45
    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
    
    0 讨论(0)
  • 2020-12-03 16:49

    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.

    0 讨论(0)
  • 2020-12-03 16:56

    Use the release of Apache Lounge , 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 fit to Windows.

    0 讨论(0)
  • 2020-12-03 16:59

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

    0 讨论(0)
提交回复
热议问题