[mod_python] Trouble on OSX - Leopard

Ben Mitchell ben at mitchellfamily.com
Mon Oct 29 23:50:54 EDT 2007


Graham,

Thanks for the help.  mod_wsgi didn't work either.  I've appended all  
the details below.

-Ben


[Macintosh:local/src/mod_wsgi-1.2] benha% ls
LICENCE		Makefile-2.X.in	configure	mod_wsgi.c
Makefile-1.X.in	README		configure.ac
[Macintosh:local/src/mod_wsgi-1.2] benha% ./configure
checking for apxs2... no
checking for apxs... /usr/sbin/apxs
checking for python... /usr/bin/python
checking Apache version... 2.2.6
configure: creating ./config.status
config.status: creating Makefile
[Macintosh:local/src/mod_wsgi-1.2] benha% make
/usr/sbin/apxs -c -I/System/Library/Frameworks/Python.framework/ 
Versions/2.5/include/python2.5 -DNDEBUG -DMACOSX -DENABLE_DTRACE   
mod_wsgi.c -framework Python -u _PyMac_Error -framework Python -ldl
/usr/share/apr-1/build-1/libtool --silent --mode=compile gcc    - 
DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp  -I/usr/include/ 
apache2  -I/usr/include/apr-1   -I/usr/include/apr-1  -I/System/ 
Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 - 
DNDEBUG -DMACOSX -DENABLE_DTRACE  -c -o mod_wsgi.lo mod_wsgi.c &&  
touch mod_wsgi.slo
/usr/share/apr-1/build-1/libtool --silent --mode=link gcc -o  
mod_wsgi.la  -rpath /usr/libexec/apache2 -module -avoid-version     
mod_wsgi.lo -framework Python -u _PyMac_Error -framework Python -ldl
[Macintosh:local/src/mod_wsgi-1.2] benha% sudo su
Password:
sh-3.2# make install
/usr/sbin/apxs -i -S LIBEXECDIR=/usr/libexec/apache2 -n 'mod_wsgi'  
mod_wsgi.la
/usr/share/httpd/build/instdso.sh SH_LIBTOOL='/usr/share/apr-1/build-1/ 
libtool' mod_wsgi.la /usr/libexec/apache2
/usr/share/apr-1/build-1/libtool --mode=install cp mod_wsgi.la /usr/ 
libexec/apache2/
cp .libs/mod_wsgi.so /usr/libexec/apache2/mod_wsgi.so
cp .libs/mod_wsgi.lai /usr/libexec/apache2/mod_wsgi.la
cp .libs/mod_wsgi.a /usr/libexec/apache2/mod_wsgi.a
ranlib /usr/libexec/apache2/mod_wsgi.a
chmod 644 /usr/libexec/apache2/mod_wsgi.a
----------------------------------------------------------------------
Libraries have been installed in:
    /usr/libexec/apache2

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
    - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
      during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
chmod 755 /usr/libexec/apache2/mod_wsgi.so
sh-3.2# exit
exit
[Macintosh:local/src/mod_wsgi-1.2] benha% sudo emacs /etc/apache2/ 
httpd.conf


ADDED the following line to httpd.conf:
LoadModule wsgi_module libexec/apache2/mod_wsgi.so


[Macintosh:local/src/mod_wsgi-1.2] benha% apachectl configtest
httpd: Syntax error on line 117 of /private/etc/apache2/httpd.conf:  
Cannot load /usr/libexec/apache2/mod_wsgi.so into server: dlopen(/usr/ 
libexec/apache2/mod_wsgi.so, 10): no suitable image found.  Did find:\n 
\t/usr/libexec/apache2/mod_wsgi.so: mach-o, but wrong architecture
[Macintosh:local/src/mod_wsgi-1.2] benha%





On Oct 29, 2007, at 2:30 PM, Graham Dumpleton wrote:

On 30/10/2007, Ben Mitchell <ben at mitchellfamily.com> wrote:
> Hi, folks.
>
> I'm working on getting Django running again after upgrading to  
> Leopard.
> I've hit a snag building / installing mod_python, and I'm hoping  
> someone
> might know what's going on.
>
> I did the following:
> - downloaded the 3.3.1 source
> - .config --with-apxs=/usr/sbin/apxs
> - make
> - sudo make install
> - added to httpd.conf:  LoadModule python_module
> libexec/apache2/mod_python.so
>
> I then ran apachectl configtest and got an error:
>
> % apachectl configtest
> httpd: Syntax error on line 116 of
> /private/etc/apache2/httpd.conf: Cannot load
> /usr/libexec/apache2/mod_python.so into server:
> dlopen(/usr/libexec/apache2/mod_python.so, 10): no suitable
> image found.  Did
> find:\n\t/usr/libexec/apache2/mod_python.so: no matching
> architecture in universal wrapper
> Any ideas?  I've tried a bunch of things tracking this down, but I  
> get this
> same error every time.

Can you do a quick test and see if you can install mod_wsgi
(http://www.modwsgi.org) instead. This can replace mod_python if all
you want to host is Django, but more importantly it follows somewhat
how mod_python is installed but is less complicated in the way it does
it. It will be easier for me to debug what the problem is if mod_wsgi
has the same issue. Can then apply what is learned from that back to
mod_python and get it working.

BTW, I presume you are using standard OS version of Python. Which
version of Python does Leopard supply if that is the case?

If you try mod_wsgi and it also fails, supply the output from doing
the initial 'make' of it so can see all the compiler flags that are
being used to build it, plus any output from compiler.

Thanks.

Graham

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20071029/22859344/attachment.html


More information about the Mod_python mailing list