0

I'm trying to install mod_wsgi on RedHat Linux.

And I'm getting this error:

apxs:Error: Command failed with rc=65536

The answer seems to be here, but I think I already have 64 bit Python so I'm not clear on what I'm supposed to do in that case.

Installation Commands:

[django - ping@e02u35]~/mod_wsgi-3.3>./configure --with-python=/usr/local/python-2.7.1/bin/python
checking for apxs2... no
checking for apxs... /usr/sbin/apxs
checking Apache version... 2.2.3
configure: creating ./config.status
config.status: creating Makefile

[django - ping@e02u35]~/mod_wsgi-3.3>make
/usr/sbin/apxs -c -I/usr/local/python-2.7.1/include/python2.7 -DNDEBUG   mod_wsgi.c -L/usr/local/python-2.7.1/lib -L/usr/local/python-2.7.1/lib/python2.7/config  -lpython2.7 -lpthread -ldl  -lutil -lm
/usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing  -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/httpd  -I/usr/include/apr-1   -I/usr/include/apr-1  -I/usr/local/python-2.7.1/include/python2.7 -DNDEBUG  -c -o mod_wsgi.lo mod_wsgi.c && touch mod_wsgi.slo
mod_wsgi.c: In function 'wsgi_server_group':
mod_wsgi.c:949: warning: unused variable 'value'
mod_wsgi.c: In function 'Log_isatty':
mod_wsgi.c:1606: warning: unused variable 'result'
mod_wsgi.c: In function 'Log_writelines':
mod_wsgi.c:1743: warning: unused variable 'msg'
mod_wsgi.c: In function 'Adapter_output':
mod_wsgi.c:3022: warning: unused variable 'n'
mod_wsgi.c: In function 'Adapter_file_wrapper':
mod_wsgi.c:4036: warning: unused variable 'result'
mod_wsgi.c: In function 'wsgi_python_term':
mod_wsgi.c:5643: warning: unused variable 'tstate'
mod_wsgi.c:5642: warning: unused variable 'interp'
mod_wsgi.c: In function 'wsgi_python_child_init':
mod_wsgi.c:6792: warning: unused variable 'l'
mod_wsgi.c:6690: warning: unused variable 'interp'
mod_wsgi.c: In function 'wsgi_add_import_script':
mod_wsgi.c:7443: warning: unused variable 'error'
mod_wsgi.c: In function 'wsgi_add_handler_script':
mod_wsgi.c:7891: warning: unused variable 'dconfig'
mod_wsgi.c:7890: warning: unused variable 'sconfig'
mod_wsgi.c: In function 'wsgi_hook_handler':
mod_wsgi.c:8937: warning: suggest parentheses around assignment used as truth value
mod_wsgi.c:8939: warning: suggest parentheses around assignment used as truth value
mod_wsgi.c:8941: warning: suggest parentheses around assignment used as truth value
mod_wsgi.c:8945: warning: suggest parentheses around assignment used as truth value
mod_wsgi.c:8965: warning: suggest parentheses around assignment used as truth value
mod_wsgi.c:8967: warning: suggest parentheses around assignment used as truth value
mod_wsgi.c:8970: warning: suggest parentheses around assignment used as truth value
mod_wsgi.c: In function 'wsgi_daemon_worker':
mod_wsgi.c:10279: warning: unused variable 'duration'
mod_wsgi.c:10278: warning: unused variable 'start'
mod_wsgi.c: In function 'wsgi_hook_daemon_handler':
mod_wsgi.c:12499: warning: unused variable 'i'
mod_wsgi.c:12497: warning: unused variable 'elts'
mod_wsgi.c:12496: warning: unused variable 'head'
mod_wsgi.c: At top level:
mod_wsgi.c:7856: warning: 'wsgi_set_user_authoritative' defined but not used
mod_wsgi.c:14414: warning: 'wsgi_hook_check_user_id' defined but not used
/usr/lib64/apr-1/build/libtool --silent --mode=link gcc -o mod_wsgi.la  -rpath /usr/lib64/httpd/modules -module -avoid-version    mod_wsgi.lo -L/usr/local/python-2.7.1/lib -L/usr/local/python-2.7.1/lib/python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm
/usr/bin/ld: /usr/local/python-2.7.1/lib/libpython2.7.a(node.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/python-2.7.1/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536
.
make: *** [mod_wsgi.la] Error 1

System info:

Linux 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
Red Hat Enterprise Linux Server release 5.3 (Tikanga)
It looks like Python 2.4 is the default Python but it has versions up to 2.7.1 installed.

Python Info:

[django - ping@e02u35]~>/usr/local/python-2.7.1/bin/python
Python 2.7.1 (r271:86832, Apr  4 2011, 13:23:54) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
2
  • What's the output of file /usr/local/python-2.7.1/bin/python?
    – chuckx
    Apr 28, 2011 at 20:07
  • I updated my question. It's at the end. What do you think? Apr 29, 2011 at 10:44

2 Answers 2

1

run 'file /usr/local/python-2.7.1/lib/libpython2.7.a' , since its in 'local' sounds like a build-from-source install, and that possibly isn't a valid ar archive.

2
  • It returns this: /usr/local/python-2.7.1/lib/libpython2.7.a: current ar archive Apr 29, 2011 at 13:39
  • 2
    my bad, I should have read more carefully: "lm /usr/bin/ld: /usr/local/python-2.7.1/lib/libpython2.7.a(node.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC" is the critical line. libpython (and in turn your likely the entire 2.7.1 python build) was compiled w/o fPIC, and you are on x86_64, so I believe its required to link against..rebuild w/ PIC, or link against a different python..
    – mmmooo
    Apr 29, 2011 at 16:57
0

See the mod_wsgi documentation at:

You need to have a shared library for Python, not a static .a only.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .