Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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
share|improve this question

1 Answer 1

up vote 1 down vote accepted

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/

share|improve this answer
    
Well, I'll have to fight trough the rest of the installation, but at least that got mod_wsgi installed! Tnx a lot:) Cant'f vote up because I'm such a server fault noob, sorry, but I've given you that funky green check mark, see? Ow and rpm happend to do have the -devel package available, installed it too, think that was where it went wrong. Anyway, thanks:) –  Jasper Kennis May 10 '11 at 16:22
    
I am running into a similar problem ( stackoverflow.com/questions/6417881/… ), however, I receive a 502 error on star4u.org/files/rhel5/x86_64/RPMS can you offer any advice? –  matchew Jun 28 '11 at 21:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.