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

I am struggling to get Apache, mod_wsgi and a hello.py script to work reliably on a Gentoo box. It works for a little while (few seconds it seems) after an Apache restart but then starts failing:

# curl "http://example.com/hello"
Hello World!
# curl "http://example.com/hello"
Hello World!
# curl "http://example.com/hello"
curl: (52) Empty reply from server
# curl "http://example.com/hello"
curl: (52) Empty reply from server

Error logs

tail -f example.com-error_log
[Thu May 03 14:51:32 2012] [info] [client xxx] mod_wsgi (pid=7317, process='', application='example.com|/hello'): Loading WSGI script '/www/cgi-bin/example.com/hello/hello.py'.

tail -f error_log
[Thu May 03 14:49:01 2012] [notice] child pid 323 exit signal Segmentation fault (11)
[Thu May 03 14:49:03 2012] [notice] child pid 376 exit signal Segmentation fault (11)

hello.py:

def application(environ, start_response):
    status = '200 OK'
    output = 'Hello World!'
    response_headers = [('Content-type', 'text/plain'),
                        ('Content-Length', str(len(output)))]
    start_response(status, response_headers)
    return [output]

Versions: Apache 2.2.22-r1, mod_wsgi 3.3, Python 2.6.4, Linux 2.6.29-gentoo-r5.

Apache config:

LoadModule wsgi_module modules/mod_wsgi.so
WSGIPythonHome /www/cgi-bin/example.com/pythonenv/BASELINE

<VirtualHost *:80>
LogLevel debug
DocumentRoot /www/cgi-bin/example.com/hello/
ServerName example.com
ErrorLog /www/logs/example.com-error_log
WSGIScriptAlias /hello /www/cgi-bin/example.com/hello/hello.py/
</VirtualHost>

Anyone know whats up? It was working previously but stopped after an emerge updated Apache.

share|improve this question
1  
which Apache MPM are you using? –  vartec May 3 '12 at 15:13
    
Any chance you have mod_python installed as well? –  Lucas Kauffman May 3 '12 at 17:43
    
I could install mod_python. Are you suggesting that I try using that instead of mod_wsgi? –  David Tinker May 4 '12 at 5:40
    
@vartec we are using worker –  David Tinker May 4 '12 at 5:56
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.