Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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>
share|improve this question

closed as off-topic by Tom O'Connor Aug 14 '13 at 21:25

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is a site dedicated to professionals; novice questions are off-topic. Please see the Help Center for more information on topicality. The best advice we can give you is to hire a professional to help you out." – Tom O'Connor
If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers 3

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).

share|improve this answer
    
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

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.

share|improve this answer
    
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 6:06

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

share|improve this answer
1  
Any resource for that? –  j0k May 19 '13 at 14:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.