Question

I wanted to experiment a little with python 3.0 at home. I got python 3.0 working, I've played around with some scripts, and I thought it would be fun to try to make a small web-project with it.

As I was googling, it turned out, that mod_python, for some reasons, will not be able to support python 3.0.

The only other alternative I've found is mod_wsgi.

On the main page of the mod_wsgi project, it says, that if you want to play with python 3.0, you have to get the latest version from subversion repository. I was wondering, if there is somewhere a pre-built windows binaries available?

If there are no such binaries, then I'd be thankful for any resources about building it with VC++ 2008. Or maybe even general resources about building apache and it's modules with VC++ 2008. Thanks.

Oh and, I'm using the latest Apache 2.2 release.

EDIT: Will it be a problem, if I'll be using the official apache build with my own build of a mod_wsgi (I used depends.exe on apache, and seems that it's not built with VC++ 2008)?

Was it helpful?

Solution

Binaries for Windows are now being supplied from the mod_wsgi site for Apache 2.2 and Python 2.6 and 3.0. Python 3.0 is only supported for mod_wsgi 3.0 onwards. See:

http://code.google.com/p/modwsgi/downloads/list


UPDATE July 2015

The above link is no longer valid. Instead see:

OTHER TIPS

I would like to find either 2.6 (preferable) or 3.0 (okay) Windows binaries myself, and have looked into this a bit.

There are Windows build steps for mod_wsgi buried deep in the Google Group for it. I think they're out of date; only one person appears to have ever done it and told the world how well it worked out. There may well be problems compiling that require a patch.

I do not think you will need to build your own Apache, or if it matters that the VC++ version is different (though I don't have a ton of evidence for this belief). VC++ version is very important for Python module builds since they rely heavily on the internals of the compiler data structures. I think the Apache module interface is more structured.

You'll probably want to post to the mod_wsgi group if you try this and hit problems, or if you successfully build the modules, please post them as some of us would very much like them but are too busy to get to doing it ourselves :(

For what it is worth, this is still (as of March 2nd 2008) up in the air as far as I can tell. See:

http://groups.google.com/group/modwsgi/browse_thread/thread/93e5e56a04fe37ab/5883f8f6a0fcc945

The same issue - lack of 2.6 binaries for windows - affects mod_python.

I think this pretty much leaves Django users running on Windows locked onto the 2.5 tree... :-(

I was able to build mod_wsgi for python 2.54 (my python is 2.5 therefore i have to use MSVC7). Using xampp Apache 2.2.14 (it is just a dev machine, for testing purposes):

Instructions:

  1. download http://adal.chiriliuc.com/temp/win32.zip
  2. unpack eg. c:/tmp/modwsgi/win32
  3. download and upack mod_wsgi http://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-3.2.tar.gz&can=2&q= into c:/tmp/modwsgi
  4. edit the c:/tmp/modwsgi/win32/generate.py
    • must set correct paths
    • i also commented out the parts for python24
  5. then cd c:/tmp/modwsgi/win32
  6. python generate.py
  7. build.bat

and you can copy mod_wsgi.so to your apache

The relevant part of the generate.py for my settings was:

##### BUILD MACHINE CONFIG #####

VS2003_PATH = r"C:\Program Files\Microsoft Visual Studio .NET 2003"

PYTHON_PATH = {
    # Put None or comment/delete the entry if a particular version is not present
    #24: r"C:\Python24",
    25: r"C:\dev\Python254",
}

APACHE_PATH = {
    # Put None or comment/delete the entry if a particular version is not present
    #20: r"c:\dev\xampp\apache",
    22: r"c:\dev\xampp\apache",
}

##### BUILD MACHINE CONFIG #####

APACHE_LIBS = {
    #20: "libhttpd.lib libapr.lib libaprutil.lib",
    22: "libhttpd.lib libapr-1.lib libaprutil-1.lib",
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top