Re: [modwsgi] mod_wsgi prevents apache start following update

82 views
Skip to first unread message

Graham Dumpleton

unread,
Oct 2, 2012, 7:25:30 PM10/2/12
to mod...@googlegroups.com
Ensure you are using mod_wsgi 3.4 and when you run 'configure' supply
the additional option:

--disable-framework

Then see if otool gives correct result.

Graham

On 3 October 2012 08:02, Jake <jake.g...@realspaces.com> wrote:
> Hi
>
> Until recently I have developing in python using mod_python but decided to
> upgrade to mod_wsgi when I upgraded from os snow leopard to mountain lion.
>
> I have followed the instructions and when I restart apache it fails to start
> up. To throw things into the mix I am trying to run mod_wsgi on python 3.2.
> I think that this should work.
>
> If I run the command
>
> "otool -L mod_wsgi.so"
>
> I get ...
>
> mod_wsgi.so:
> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
> 169.3.0)
> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
> (compatibility version 150.0.0, current version 744.12.0)
>
> From what I can see from the notes that have been pasted this is not
> correct.
>
> Can anyone point me in the right direction, an idiot guide would be useful.
>
> Thanks
>
> J
>
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/modwsgi/-/EW137QGfKEwJ.
> To post to this group, send email to mod...@googlegroups.com.
> To unsubscribe from this group, send email to
> modwsgi+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/modwsgi?hl=en.

Jake

unread,
Oct 3, 2012, 4:08:27 PM10/3/12
to mod...@googlegroups.com
Hi Graham, thanks for the pointer but it hasn't worked. Here is what I entere into terminal;

<hostname>:mod_wsgi-3.4 <user>$ ./configure --with-python=/Library/Frameworks/Python.framework/Versions/3.2/bin/python3 --disable-framework
checking for apxs2... no
checking for apxs... /usr/sbin/apxs
checking Apache version... 2.2.22
configure: creating ./config.status
config.status: creating Makefile
<hostname>:mod_wsgi-3.4 <user>$ make
make: Nothing to be done for `all'.
<hostname>:mod_wsgi-3.4 <user>$ sudo make install
Password:
/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
chmod 644 /usr/libexec/apache2/mod_wsgi.a
ranlib /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

When I run otool I still get the same output,

<hostname>:apache2 <user>$ otool -L mod_wsgi.so 
mod_wsgi.so:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 744.12.0)

The version of mod_wsgi is the tar that is available at the following location download here.

Any ideas?

Thanks

Jake

Graham Dumpleton

unread,
Oct 3, 2012, 5:25:19 PM10/3/12
to mod...@googlegroups.com
Run 'make distclean' in the directory before you rerun configure. You
still had old build results lying around by the look of it.
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/modwsgi/-/JvTfxYObF74J.

Jake

unread,
Oct 3, 2012, 5:33:23 PM10/3/12
to mod...@googlegroups.com
I  had deleted the previous download and started with a clean one. Not sure if the 'make distclean' will do anything.

I ran it anyway and got the following ;

make: *** No rule to make target `distclean'.  Stop.

Which I think is to be expected.

Graham Dumpleton

unread,
Oct 3, 2012, 5:55:44 PM10/3/12
to mod...@googlegroups.com
The output you gave showed:

<hostname>:mod_wsgi-3.4 <user>$ make
make: Nothing to be done for `all'.

which indicated that make had already been run in the directory again.

From that fresh source code, do the configure and make and then run:

otool -L .libs/mod_wsgi.so

without doing an install.

See what the local .so file is before anything gets installed.

Graham
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/modwsgi/-/W3FEnec4nRMJ.

Jake

unread,
Oct 4, 2012, 5:39:54 PM10/4/12
to mod...@googlegroups.com
Graham

These are the steps that I followed and the output I received;
1.
./configure --with-python=/Library/Frameworks/Python.framework/Versions/3.2/bin/python3 --disable-framework
2. 
make
3. 
cd .libs
4. 
otool -L mod_wsgi.so

Output
mod_wsgi.so:
/Library/Frameworks/Python.framework/Versions/3.2/Python (compatibility version 3.2.0, current version 3.2.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 744.12.0)

Is this the correct output???

Best regards

Jake

Graham Dumpleton

unread,
Oct 4, 2012, 8:42:26 PM10/4/12
to mod...@googlegroups.com
The output is correct, although one thing worried me.

Can you confirm that you manually installed Python 3.2, because a
system Python wouldn't be under:

/Library/Frameworks/Python.framework

What Python versions are under:

/System/Library/Frameworks/Python.framework/Versions

I ask as I am not sure what ships with Mountain Lion.

Also, if Python 3.2 was installed manually, did you use the Python
Software Foundation binary installer or one from somewhere else. The
PSF installer is notorious for requiring --disable-framework option
and I don't know what they do differently when building it to break
normal framework linking.

Graham
> https://groups.google.com/d/msg/modwsgi/-/U1TxsZNz-D0J.

Jake

unread,
Oct 5, 2012, 3:31:53 PM10/5/12
to mod...@googlegroups.com
With Mountain lion it comes with versions 2.3, 2.5, 2.6, & 2.7. These are installed as you have correctly stated however the installation is a little different compared to a linux installation. 

The version 3.2 that I have installed is from the python site at the following location http://www.python.org/download/releases/3.2.3/. I took the osx 64bit installer.

The installation location is as per the installer.

Jake

Graham Dumpleton

unread,
Oct 5, 2012, 6:54:45 PM10/5/12
to mod...@googlegroups.com
With otool -L showing the correct result, what then was the result
when you tried to actually use it with Apache???

If there is still a run time linking issue causing Apache not to
start, you can usually see the error by running:

sudo /usr/sbin/apachectl -t

It will show any linker error as output immediately.

Graham
> https://groups.google.com/d/msg/modwsgi/-/E8_IpwXkYrYJ.

Jake

unread,
Oct 7, 2012, 9:10:32 AM10/7/12
to mod...@googlegroups.com
Hi Graham

I have carried out the make install now and when I run the otool on the installed mod_wsgi.so I get the following result;

mod_wsgi.so:
/Library/Frameworks/Python.framework/Versions/3.2/Python (compatibility version 3.2.0, current version 3.2.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 744.12.0)

I guess that this is correct now and apache restarts without causing errors. Now just to configure httpd.conf and my virtual hosts then I can get on with playing and finding out how to take advantage of mod_wsgi over mod_python.

Thanks for your help.

Jake
Reply all
Reply to author
Forward
0 new messages