Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8098205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:00:36+00:00 2026-06-05T22:00:36+00:00

so i’m getting segfaults with my django wsgi application in mod_wsgi via apache 2.22

  • 0

so i’m getting segfaults with my django wsgi application in mod_wsgi via apache 2.22

here’s the wsgi app:

import os
import sys

sys.path.append('/home/***.com/zpencerq')
sys.path.append('/home/***.com/zpencerq/part')

os.environ['DJANGO_SETTINGS_MODULE'] = 'part.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

here’s the error from the logs:

[Mon Jun 18 18:13:39 2012] [info] mod_wsgi (pid=78535): Create interpreter 'www.***.com|'.
[Mon Jun 18 18:13:39 2012] [info] [client 128.227.57.184] mod_wsgi (pid=78535, process='***', application='www.***.com|'): Loading WSGI script '/usr/home/***.com/zpencerq/part/apache/django.wsgi'.
[Mon Jun 18 18:13:39 2012] [error] [client 128.227.57.184] Premature end of script headers: django.wsgi
[Mon Jun 18 18:13:40 2012] [notice] child pid 78535 exit signal Segmentation fault (11)

here’s the library references of mod_wsgi:

root@seese# ldd /usr/local/apache/modules/mod_wsgi.so
/usr/local/apache/modules/mod_wsgi.so:
        libpython2.7.so.1 => /usr/local/lib/libpython2.7.so.1 (0x28300000)
        libutil.so.7 => /lib/libutil.so.7 (0x2819f000)
        libm.so.5 => /lib/libm.so.5 (0x281ac000)
        libc.so.7 => /lib/libc.so.7 (0x28080000)
        libthr.so.3 => /lib/libthr.so.3 (0x281c1000)

here are the loaded modules:

Loaded Modules:
 core_module (static)
 authn_file_module (static)
 authn_default_module (static)
 authz_host_module (static)
 authz_groupfile_module (static)
 authz_user_module (static)
 authz_default_module (static)
 auth_basic_module (static)
 include_module (static)
 filter_module (static)
 deflate_module (static)
 log_config_module (static)
 env_module (static)
 setenvif_module (static)
 version_module (static)
 mpm_prefork_module (static)
 http_module (static)
 mime_module (static)
 status_module (static)
 autoindex_module (static)
 asis_module (static)
 suexec_module (static)
 cgi_module (static)
 negotiation_module (static)
 dir_module (static)
 actions_module (static)
 userdir_module (static)
 alias_module (static)
 so_module (static)
 php5_module (shared)
 wsgi_module (shared)
Syntax OK

here are the compiled in modules:

root@seese# httpd -l
Compiled in modules:
  core.c
  mod_authn_file.c
  mod_authn_default.c
  mod_authz_host.c
  mod_authz_groupfile.c
  mod_authz_user.c
  mod_authz_default.c
  mod_auth_basic.c
  mod_include.c
  mod_filter.c
  mod_deflate.c
  mod_log_config.c
  mod_env.c
  mod_setenvif.c
  mod_version.c
  prefork.c
  http_core.c
  mod_mime.c
  mod_status.c
  mod_autoindex.c
  mod_asis.c
  mod_suexec.c
  mod_cgi.c
  mod_negotiation.c
  mod_dir.c
  mod_actions.c
  mod_userdir.c
  mod_alias.c
  mod_so.c

here are some python goodies:

root@seese# ls -l /usr/local/bin/python*
lrwxr-xr-x  1 root  wheel     7 Jun 17 13:30 /usr/local/bin/python -> python2
lrwxr-xr-x  1 root  wheel    14 Jun 17 13:30 /usr/local/bin/python-config -> python2-config
-r-xr-xr-x  1 root  wheel  3420 Mar  6 01:22 /usr/local/bin/python-shared2.7
-r-xr-xr-x  1 root  wheel  1631 Mar  6 01:22 /usr/local/bin/python-shared2.7-config
lrwxr-xr-x  1 root  wheel     9 Jun 17 13:30 /usr/local/bin/python2 -> python2.7
lrwxr-xr-x  1 root  wheel    16 Jun 17 13:30 /usr/local/bin/python2-config -> python2.7-config
-rwxr-xr-x  1 root  wheel  8084 Jun 17 13:30 /usr/local/bin/python2.7
-rwxr-xr-x  1 root  wheel  1624 Jun 17 13:30 /usr/local/bin/python2.7-config

i’ve been at this for a very long time haha, and very frustrated with the many headaches that came along the way. if someone (perhaps graham dumpleton!) could help me out that would be amazing

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:00:38+00:00Added an answer on June 5, 2026 at 10:00 pm

    Quoting from mod_wsgi docs:

    Q: Why when first request is made against a WSGI application does the
    Apache server process handling the request crash with a ‘segmentation
    fault’?

    A: This is nearly always caused due to a shared library version
    conflict. That is, Apache or some Apache module is linked against a
    different version of a library than that which is being used by a
    particular Python module that the WSGI application makes use of. The
    most common culprits are the expat and MySQL libraries, but it can
    also occur with other shared libraries.

    Another cause of a process crash only upon the first request can be a
    third party C extension module for Python which has not been
    implemented so as to work within a secondary Python sub interpreter.
    The Python bindings for Subversion are a particular example, with the
    Python module only working correctly if the WSGI application is forced
    to run within the first interpreter instance created by Python.

    Further information on these problems can be found in various sections
    of Application Issues. The problems with the expat library are also
    gone into in more detail in Issues With Expat Library.

    I see you have Apache and Python both installed at /usr/local/, so I assume you have compiled them. You have to make sure the C extensions used in your code are linked against the right versions too. The other option is, you’re using some buggy module that behaves badly when loaded via mod_wsgi.

    Can you run your application without mod_wsgi, running ./manage.py for instance?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am writing an app with both english and french support. The app requests
Thanks in advance for your help. I have a need within an application to
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.