mod_wsgi.so isnt being compiled / made

53 views
Skip to first unread message

Mike Chambers

unread,
Apr 26, 2008, 1:47:58 AM4/26/08
to modwsgi
I am struggling to compile mod_wsgi on linux (centos)

I have compiled python with --enabled-shared, and after some initial
issues it is working (the libpython2.5.so.1.0 file wasnt being found
by python)

Basically, the mod_wsgi.so file is not being created (and im not sure
why).

python : 2.5.2
mod-wsgi: 2.0
apache: 2.2.8

It looks like I have the same issue as mentioned here:
http://groups.google.com/group/modwsgi/browse_thread/thread/1a001dd58c58c942/1b8d1b02b0c54eb4?lnk=gst&q=No+such+file+or+directory+mod_wsgi.so#1b8d1b02b0c54eb4

although the post doesnt say how they ended up getting the .so to
compile.

Here is the output from configure, make and make install.

./configure --with-apxs=/usr/local/apache2_new/bin/apxs
checking Apache version... 2.2.8
checking for python... /usr/local/bin/python
configure: creating ./config.status
config.status: creating Makefile
[mesh@mikechambers mod_wsgi-2.0]$ make
/usr/local/apache2_new/bin/apxs -c -I/usr/local/include/python2.5 -
DNDEBUG mod_wsgi.c -L/usr/local/lib/python2.5/config -lpython2.5 -
lpthread -ldl -lutil
/usr/local/apache2_new/build/libtool --silent --mode=compile gcc -
prefer-pic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -
D_LARGEFILE64_SOURCE -g -O2 -pthread -I/usr/local/apache2_new/include
-I/usr/local/apache2_new/include -I/usr/local/apache2_new/include -
I/usr/local/include/python2.5 -DNDEBUG -c -o mod_wsgi.lo mod_wsgi.c
&& touch mod_wsgi.slo
In file included from /usr/local/include/python2.5/Python.h:8,
from mod_wsgi.c:113:
/usr/local/include/python2.5/pyconfig.h:942:1: warning:
"_POSIX_C_SOURCE" redefined
In file included from /usr/include/sys/types.h:27,
from /usr/local/apache2_new/include/apr.h:116,
from /usr/local/apache2_new/include/ap_config.h:25,
from /usr/local/apache2_new/include/httpd.h:43,
from mod_wsgi.c:34:
/usr/include/features.h:150:1: warning: this is the location of the
previous definition
/usr/local/apache2_new/build/libtool --silent --mode=link gcc -o
mod_wsgi.la -rpath /usr/local/apache2_new/modules -module -avoid-
version mod_wsgi.lo -L/usr/local/lib/python2.5/config -lpython2.5 -
lpthread -ldl -lutil


sudo make install
/usr/local/apache2_new/bin/apxs -i -S LIBEXECDIR=/usr/local/
apache2_new/modules -n 'mod_wsgi' mod_wsgi.la
/usr/local/apache2_new/build/instdso.sh SH_LIBTOOL='/usr/local/
apache2_new/build/libtool' mod_wsgi.la /usr/local/apache2_new/modules
/usr/local/apache2_new/build/libtool --mode=install cp mod_wsgi.la /
usr/local/apache2_new/modules/
cp .libs/mod_wsgi.lai /usr/local/apache2_new/modules/mod_wsgi.la
cp .libs/mod_wsgi.a /usr/local/apache2_new/modules/mod_wsgi.a
chmod 644 /usr/local/apache2_new/modules/mod_wsgi.a
ranlib /usr/local/apache2_new/modules/mod_wsgi.a
PATH="$PATH:/sbin" ldconfig -n /usr/local/apache2_new/modules
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/apache2_new/modules

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 `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Warning! dlname not found in /usr/local/apache2_new/modules/
mod_wsgi.la.
Assuming installing a .so rather than a libtool archive.
chmod 755 /usr/local/apache2_new/modules/mod_wsgi.so
chmod: cannot access `/usr/local/apache2_new/modules/mod_wsgi.so': No
such file or directory
apxs:Error: Command failed with rc=65536
.
make: *** [install] Error 1

Anyone have any idea what might be going on?

mike

Mike Chambers

unread,
Apr 26, 2008, 1:56:36 AM4/26/08
to modwsgi
fyi

I had the same issue as mentioned here:

http://groups.google.com/group/modwsgi/browse_thread/thread/731d6fab1898c7b1/8fe353d528d77698?lnk=gst&q=mod_wsgi.la#8fe353d528d77698

although my mod_wsgi.so isnt compiling.

mike

Graham Dumpleton

unread,
Apr 26, 2008, 3:26:05 AM4/26/08
to mod...@googlegroups.com
2008/4/26 Mike Chambers <mikech...@gmail.com>:

Hmmm, so you gave up on trying to solve same problem with mod_python
and thought you would try mod_wsgi instead. :-)

What do you get after having done the initial 'make' when you run:

$ ls -las .libs/

In other words, what make output is in the '.libs' subdirectory of the
mod_wsgi source code.

One would expect with Apache 2.X to see something like:

total 904
0 drwxr-xr-x 7 grahamd staff 238 21 Apr 21:13 .
0 drwxr-xr-x 20 grahamd staff 680 21 Apr 21:13 ..
312 -rw-r--r-- 1 grahamd staff 159720 21 Apr 21:13 mod_wsgi.a
8 lrwxr-xr-x 1 grahamd staff 14 21 Apr 21:13 mod_wsgi.la ->
../mod_wsgi.la
8 -rw-r--r-- 1 grahamd staff 801 21 Apr 21:13 mod_wsgi.lai
312 -rw-r--r-- 1 grahamd staff 159476 21 Apr 21:13 mod_wsgi.o
264 -rwxr-xr-x 1 grahamd staff 133048 21 Apr 21:13 mod_wsgi.so

If the .so file is in there, copy it by hand to Apache modules
directory instead of using 'make install'.

As suggested on mod_python list, there would appear to be something
amiss with your libtool installation, or alternatively with the 'apxs'
script provided with your version of Apache.

Since mod_wsgi needs only the one file installed, it is safe to just
copy it into place.

Graham

Mike Chambers

unread,
Apr 26, 2008, 3:43:23 AM4/26/08
to mod...@googlegroups.com

Graham Dumpleton wrote:

>
> Hmmm, so you gave up on trying to solve same problem with mod_python
> and thought you would try mod_wsgi instead. :-)

Oh man, it has been one of those days where nothing will work.


> What do you get after having done the initial 'make' when you run:
>
> $ ls -las .libs/


284 -rw-rw-r-- 1 mesh mesh 284854 Apr 26 00:29 mod_wsgi.a
0 lrwxrwxrwx 1 mesh mesh 14 Apr 26 00:29 mod_wsgi.la ->
../mod_wsgi.la
4 -rw-rw-r-- 1 mesh mesh 828 Apr 26 00:29 mod_wsgi.lai


notice no mod_wsgi.so


> As suggested on mod_python list, there would appear to be something
> amiss with your libtool installation, or alternatively with the 'apxs'
> script provided with your version of Apache.

Yes. I was starting to suspect that, and after your email, finally
figured it out.

I removed the libtool in the apache/build dir, and added a simlink to
the version I already had on my system, and was able to finally build
and compile mod_wsgi.a (and mod_python.so!).

For future reference, the version that worked for me was:

(libtool 1.2627 2008/04/01 23:32:01) 2.2.2

The version included with Apache 2.2.8 wouldnt work for me.

Man, what a day. Thanks for the help. Now I need to figure out which one
I want to run.

mike

Graham Dumpleton

unread,
Apr 26, 2008, 4:52:18 AM4/26/08
to mod...@googlegroups.com
2008/4/26 Mike Chambers <mikech...@gmail.com>:

If you have no need to be writing custom Python code to hook into
internals of Apache and only want to run a Python web
framework/application which supports WSGI, there is no real point
using mod_python these days. The mod_wsgi package performs better,
uses less memory and also has daemon mode which allows for process
separation between applications and allows applications to run as
different users. Anyway, that is my sales pitch. :-)

Graham

Mike Chambers

unread,
Apr 26, 2008, 5:03:18 AM4/26/08
to mod...@googlegroups.com
Hehe... thanks. I just got everything running under mod_python. It is 2
AM here, so first thing it the morning im going to try to get my app
(django based) running with wsgi).

I need to check on the php mysql issue mentioned here first:

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

Thanks for all of your help...

mike

Graham Dumpleton wrote:
> 2008/4/26 Mike Chambers <mikech...@gmail.com>:

Reply all
Reply to author
Forward
0 new messages