Cant make mod_wsgi-3.3 on centos, is there a python2.7-dev(el) package?

I’m trying to get mod_wsgi to work om my CentOs server so I can run Django sites on apache. I’ve installed python2.7 paralel to 2.4 (because you have to keep 2.4 in order to keep yum happy), the root user is using 2.7. I want to do:

# wget http://modwsgi.googlecode.com/files/mod_wsgi-3.3.tar.gz
# tar -zxvf mod_wsgi-3.3.tar.gz
# cd mod_wsgi-3.3
# ./configure --help
# ./configure --with-python=/usr/local/python27/bin/python
# make
# make_install

but make fails; it gives me a huge error I’ll post below. I’ve been googling around and found that I’m probably missing a python2.7-dev or python2.7-devel package, something like that, also because the first line of the error reports a missing .h file.

But I can’t find a devel package for 2.7 on centos. So I was hoping someone could give me a hint here, tnx.

This is the error, I’ve removed a lot in the middle! Thanks in advance!

[root@ve mod_wsgi-3.3]# make
/usr/sbin/apxs -c   mod_wsgi.c -Wl,-F -framework    
/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   -c -o mod_wsgi.lo mod_wsgi.c && touch mod_wsgi.slo
mod_wsgi.c:135:20: error: Python.h: No such file or directory
mod_wsgi.c:138:2: error: #error Sorry, Python developer package does not appear to be installed.
mod_wsgi.c:142:2: error: #error Sorry, mod_wsgi requires at least Python 2.3.0 for Python 2.X.
mod_wsgi.c:150:2: error: #error Sorry, mod_wsgi requires that Python supporting thread.
mod_wsgi.c:153:21: error: compile.h: No such file or directory
mod_wsgi.c:154:18: error: node.h: No such file or directory
mod_wsgi.c:155:20: error: osdefs.h: No such file or directory
mod_wsgi.c:188: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Auth_Type'
mod_wsgi.c: In function 'wsgi_server_group':
mod_wsgi.c:949: warning: unused variable 'value'
mod_wsgi.c: At top level:
mod_wsgi.c:1348: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Dispatch_Type'
mod_wsgi.c:1351: error: expected specifier-qualifier-list before 'PyObject_HEAD'
mod_wsgi.c:1363: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Log_Type'
mod_wsgi.c:1365: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token

### Endless jaberish about missing files, members, misinterpreted characters, unused vars and whatnot. Not going to post it all, unless someone needs it.

mod_wsgi.c:14469: error: expected ';' before 'apr_thread_mutex_lock'
mod_wsgi.c:14470: error: 'Py_END_ALLOW_THREADS' undeclared (first use in this function)
mod_wsgi.c:14473: error: expected ';' before 'modules'
mod_wsgi.c:14474: error: expected identifier or '(' before '=' token
mod_wsgi.c:14476: error: expected expression before 'module'
mod_wsgi.c:14478: error: expected expression before 'module'
mod_wsgi.c:14487: error: expected expression before 'module'
mod_wsgi.c:14488: error: expected expression before 'module'
mod_wsgi.c:14499: error: expected expression before 'module'
mod_wsgi.c:14500: error: expected identifier or '(' before '=' token
mod_wsgi.c:14506: error: expected expression before 'module'
mod_wsgi.c:14507: error: expected identifier or '(' before '=' token
mod_wsgi.c:14522: error: expected expression before 'module'
mod_wsgi.c:14523: error: 'module_dict' undeclared (first use in this function)
mod_wsgi.c:14524: error: 'object' undeclared (first use in this function)
mod_wsgi.c:14526: error: expected expression before 'module'
mod_wsgi.c:14530: error: 'vars' undeclared (first use in this function)
mod_wsgi.c:14531: error: 'args' undeclared (first use in this function)
mod_wsgi.c:14532: error: 'result' undeclared (first use in this function)
mod_wsgi.c:14533: error: 'method' undeclared (first use in this function)
mod_wsgi.c:14550: error: 'Py_None' undeclared (first use in this function)
mod_wsgi.c:14564: error: 'Py_True' undeclared (first use in this function)
mod_wsgi.c:14567: error: 'Py_False' undeclared (first use in this function)
mod_wsgi.c:14579: error: 'PyExc_TypeError' undeclared (first use in this function)
mod_wsgi.c:14595: error: 'AuthObject' has no member named 'r'
mod_wsgi.c:14599: error: 'AuthObject' has no member named 'log'
mod_wsgi.c:14602: error: 'PyExc_AttributeError' undeclared (first use in this function)
mod_wsgi.c:14604: error: 'AuthObject' has no member named 'log'
mod_wsgi.c:14617: error: expected expression before ')' token
mod_wsgi.c:14624: error: expected ';' before 'ap_log_rerror'
mod_wsgi.c:14629: error: expected ';' before '}' token
mod_wsgi.c:14634: error: too many arguments to function 'wsgi_log_python_error'
mod_wsgi.c:14639: error: expected expression before 'module'
apxs:Error: Command failed with rc=65536
.
make: *** [mod_wsgi.la] Error 1

Answer

I would completely remove that and install 2.7 rpms instead.

rm -rf /usr/local/python27/

Then for 64bit

http://star4u.org/files/rhel5/x86_64/RPMS/

32bit

http://star4u.org/files/rhel5/i386/RPMS/

Attribution
Source : Link , Question Author : Jasper Kennis , Answer Author : Mike

Leave a Comment