Saved for later reference

online repository of stuff I had to google for hours to figure out – and random snippets of code

Making a Trac install work on Apache 2.2/Python 2.6/win32, 2010 edition

Tags: , , , , , ,

About 10 months ago I wrote a short article on getting Trac to work on Python 2.6 and Windows. Recently I updated the install, and took a look at how the situation is now.

This guide assumes you have a working install of Trac on Python 2.5/mod_python/Apache2.2 already, as described in the Trac install guide, and that Python 2.6 is installed.

What needs to be done:

  • Install Python 2.6 and Trac for 2.6
  • Build a new version of mod_python
  • Optionally Replace Apache DLLs (mostly if you followed my previous guide)

Required software

You’ll need Visual C++ 2008 Express Edition or any retail version of VS 2008 if you want to build your own mod_python for 2.6 (I’ll provide a precompiled one in this post).

Preparing

Install Python 2.6 and Trac on 2.6 (using “ easy_install trac” is recommended)

You’ll probably also want to easy_install Pygments for source highlighting.

Building mod_python for 2.6

This guide to mod_python covers the creation and installation of a compatible version of the module.

At this point, you should be able to restart Apache and load up your “old” Trac on Python 2.6, but with the error message that “svn” support is not installed.

A pre-built version of this can be found here: mod_python-3.3.2-dev-20080819.win32-py2.6.exe

Python SVN bindings

My old guide had instructions on how to build these yourself, but after that article was made, “official” Python 2.6 bindings have been released.

Most recent version as of this writing is the SVN 1.6.6 version of the bindings.

Replacing Apache DLLs to make libsvn work

Note: Only use these instructions if you experience problems, and/or you’re running a self-built version of the Python SVN bindings already.

There’s a slight difference between libapr-1.dll as supplied with Apache 2.2 and the one we built together with libsvn, so the fix is to replace the one in your Apache2.2\bin folder with the one from your Python2.6\Lib\site-packages\libsvn folder (copy the libsvn_*.dlls from the same folder into the Apache2.2\bin folder if you still get problems).

Restarting Apache now should make Trac work fully, with Subversion support.

Share

Compiling Subversion Python bindings on Windows

Tags: , , , , , ,

I tried finding good instructions on building the Python SVN bindings (for use with Trac), but the included readme file is based on Visual C++ 5.0/6.0 (which I remember using back in ’98), and leaves out a few crucial steps.

So, this how-to will explain the process of building SVN bindings for Python 2.6 on Windows.

What you’ll need:

  • Visual C++ 2008 Express Edition (Visual Studio 2008 will also work, but will base this on free downloads)
  • Swig (I used swigwin-1.3.39 specifically, but any newer version should do)
  • Subversion source – grab both the source file subversion-1.6.0.zip and the dependencies subversion-deps-1.6.0.zip

Preparing

Start with installing VC++ 2008 Express and Python if you haven’t already, then create a folder to store the source trees (I used C:\Temp – and will use that folder in the instructions here for simplicity). Unpack Swig to C:\Temp\swig, and subversion-1.6.0.zip and subversion-deps-1.6.0.zip to C:\Temp (which should create the folder “C:\Temp\subversion-1.6.0″).

Make sure you have C:\Python26 in your path.
Read the rest of this entry »

Share

© 2009 Saved for later reference. All Rights Reserved.

This blog is powered by Wordpress and Magatheme by Bryan Helmig.