The Golden Spot

I hope this helps someone who is learning about Linux and web application programming with Python, Django, and Javascript.

Friday, November 07, 2008

mod_wsgi
Apache 2.2.10
Python 2.6
Django latest from subversion
on Debian Etch ADM64

compiling mod_wsgi, Python 2.6 and Apache 2.2.10 worked for me by configuring Python 2.6 with


--enable-shared

then after make and make install:


$ ln -s /usr/local/lib/libpython2.6.so.1.0 /lib


Next, link the python shared object to a place that mod_wsgi will use it.


$ sudo ln -s /usr/local/lib/libpython2.6.so /usr/local/lib/python2.6/config/


I compiled Apache successfully by building it with


./configure --with-included-apr --enable-ssl --prefix=/usr/local/apache2 --enable-so


then configure mod_wsgi using


$ ./configure --with-python=/usr/local/bin/python2.6 --with-apxs=/usr/local/apache2/bin/apxs


I checked that the /usr/local/apache2/modules/mod_wsgi.so was compiled with the python shared object by doing this

$ ldd /usr/local/apache2/modules/mod_wsgi.so

It shows that it was compiled with



libpython2.6.so.1.0 => /lib/libpython2.6.so.1.0 (0x00002b99a1f1d000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00002b99a21c8000)
libdl.so.2 => /lib/libdl.so.2 (0x00002b99a22dd000)
libutil.so.1 => /lib/libutil.so.1 (0x00002b99a23e0000)
libc.so.6 => /lib/libc.so.6 (0x00002b99a24e4000)
libm.so.6 => /lib/libm.so.6 (0x00002b99a2721000)
/lib64/ld-linux-x86-64.so.2 (0x0000555555554000)




The test on

http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide

worked; So, off to my Django web development.

P.S. Thanks to Graham Dumpleton for help on

http://groups.google.com/group/modwsgi

from last year when I was trying to get this working with python 2.5 and an older version of Apache. Back then, I never got it to work and ended up using mod_python instead.

Labels: , , , ,

2 Comments:

Anonymous Yeago said...

Thanks!

2:35 PM  
Blogger Kevin said...

Excellent job. I've been wrestling with the apache2, mod_wsgi, python2.6 combo all day now. Thank you very much!!!

10:05 PM  

Post a Comment

<< Home