[mod_python] Trouble on OSX - Leopard

Ben Mitchell ben at mitchellfamily.com
Tue Oct 30 00:41:57 EDT 2007


Looks ok to me, though we're way out of my depth at this point :-)


[Macintosh:~/Documents/Development] benha% file /usr/sbin/httpd
/usr/sbin/httpd: Mach-O universal binary with 4 architectures
/usr/sbin/httpd (for architecture ppc7400):	Mach-O executable ppc
/usr/sbin/httpd (for architecture ppc64):	Mach-O 64-bit executable ppc64
/usr/sbin/httpd (for architecture i386):	Mach-O executable i386
/usr/sbin/httpd (for architecture x86_64):	Mach-O 64-bit executable  
x86_64
[Macintosh:~/Documents/Development] benha% file /usr/libexec/apache2/ 
mod_wsgi.so
/usr/libexec/apache2/mod_wsgi.so: Mach-O bundle i386
[Macintosh:~/Documents/Development] benha%



On Oct 29, 2007, at 9:35 PM, Graham Dumpleton wrote:

One more and then I will have exhausted my ideas and may have to
research elsewhere.

  file /usr/sbin/httpd

Change path if this isn't what Apache server executable is called.

  file /usr/libexec/apache2/*.so

This is to see what other Apache and other modules are compiled as.
Ie., Intel only or dual architecture etc.

Graham

On 30/10/2007, Ben Mitchell <ben at mitchellfamily.com> wrote:
>
> [Macintosh:local/src/PyGreSQL-3.8.1] benha% otool -L
> /usr/libexec/apache2/mod_wsgi.so
> /usr/libexec/apache2/mod_wsgi.so:
> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current  
> version
> 111.0.0)
> /Library/Frameworks/Python.framework/Versions/2.5/Python
> (compatibility version 2.5.0, current version 2.5.0)
> /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current  
> version
> 1.0.0)
> [Macintosh:local/src/PyGreSQL-3.8.1] benha%
>
>
>
>
> On Oct 29, 2007, at 9:18 PM, Graham Dumpleton wrote:
> How about:
>
>  otool -L /usr/libexec/apache2/mod_wsgi.so
>
> Should refer to standard Python framework.
>
> Graham
>
> On 30/10/2007, Ben Mitchell <ben at mitchellfamily.com> wrote:
>
> I started off yesterday doing an "Upgrade."  But I found enough  
> weirdness
> that I did an "Archive and Install" tonight.  It's an intel MacBook  
> Pro.
>
> [Macintosh:/private/var/mysql] benha% file
> /usr/libexec/apache2/mod_wsgi.so
> /usr/libexec/apache2/mod_wsgi.so: Mach-O bundle i386
>
>
>
>
>
> On Oct 29, 2007, at 9:06 PM, Graham Dumpleton wrote:
> What does it say if you run:
>
>  file /usr/libexec/apache2/mod_wsgi.so
>
> BTW, is this a PPC or Intel machine?
>
> Did you do a fresh install or an upgrade of Leopard?
>
> Graham
>
> On 30/10/2007, Ben Mitchell <ben at mitchellfamily.com> wrote:
>
> 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.
>
>
>
>

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


More information about the Mod_python mailing list