5

Python interested me as a web scripting language so I wanted to set it up on my testing server.

Cannot get Apache to restart with mod_wsgi. Running xampp v win32-1.8 w/apache v2.4, python v2.7 32bit, on win7 64bit. The registry files I see for Python are in hkey_classes_root. I not sure if that should be right but there are none in the hkey_current_user. The one in hkey_local_machine says default value not set.

This is what I get when I run apache_start.bat

Apache 2 is starting ...
httpd.exe: Syntax error on line 141 of C:/xampp/apache/conf/httpd.conf: Cannot load C:/xampp/apache/modules/mod_wsgi.so into server: The specified procedure could not be found.

What I have added to httpd.conf:

LoadModule wsgi_module modules/mod_wsgi.so

WSGIScriptAlias /wsgi_handler "C:/xampp/wsgi/mywsgi.py"

<Directory "C:/xampp/wsgi">
Order allow,deny
Allow from all
</Directory>
HopelessN00b
  • 53,385
  • 32
  • 133
  • 208
chris
  • 51
  • 1
  • 2

3 Answers3

2

Check your modules directory for Apache to see if you have mod_wsgi available. Also since you're running Windows you'll be looking for a .dll file and not a .so (Unix specific).

WinkyWolly
  • 598
  • 6
  • 19
  • I guess I don't know where you are referring because this was installed with the prepackaged installer for windows and all the modules in the apache module folder are .so Just tried the same setup with mod_python, installed python 2.5 and followed the instructions on that site and does the exact same thing. when I comment out the LoadModule line it Apache works fine just like with the wsgi module. I now have both mod_wsgi.so and mod_python.so in C:/xampp/apache/modules – chris Oct 16 '12 at 21:06
  • That seems strange. Arguably it's "possible" but I've never seen it in an Apache deployment (inherently different formats of dynamic libraries..). Regardless the error you're showing is explicitly stating it cannot find your module - verify your paths / configuration in `httpd.conf`. – WinkyWolly Oct 16 '12 at 23:45
1

Problems with starting up Apache generally arises for the following reasons.

  1. Python was not installed for all users of system, but was only installed for the user that did the installation.
  2. Apache, Python and mod_wsgi.so are not all 32 bit, or not all 64 bit. You cannot mix 32 and 64 bit versions, must all be the same.
  3. If mod_wsgi.so was a binary, it is not the correct binary for Python or Apache version being used.

Note that you cannot load module mod_python and mod_wsgi at the same time if they use different Python versions.

Where did you get your mod_wsgi.so binary from. You say you are using Apache 2.4 but there are no pre built mod_wsgi.so binaries available that I know of.

Graham Dumpleton
  • 5,990
  • 2
  • 20
  • 19
  • Thanks for the help. Got it working finally. Changed version of xampp to 1.7.7 w/Apache 2.2 – chris Oct 18 '12 at 06:06
0

The Apache version 2.4 is not yet support by mod_wsgi.so version 3.3

Try using Apache version 2.2

The version 3.4 of mod_wsgi.so is available now, and it support Apache 2.4! http://code.google.com/p/modwsgi/wiki/ChangesInVersion0304

Montri M
  • 101
  • 2