Regarding the inclusion of site-packages, I've worked on a myriad of Django projects and I've seen in quite a few of them that certain developers like to import Python libraries directly, using just its name. I was under the impression that mod_wsgi needed to have this mapped for it to work correctly, I'm sorry if that is not the case.
And I agree that it ties the wsgi setup to Python 2.5, but the document is already somewhat angled towards the specific Ubuntu 8.04 distro, seeing as it has a few quirks. But I will remove it from the guide heeding your recommendation. If you have any other feedback regarding any other aspect of the guide, I would love to hear it. Paul On Feb 24, 11:12 am, Graham Dumpleton <[email protected]> wrote: > On Feb 24, 10:06 pm, Graham Dumpleton <[email protected]> > wrote: > > > > > On 24/02/2009, at 9:59 PM, Paul Skarseth wrote: > > > > Hi, > > > > I've made a guide as how to set up an efficient and robust server to > > > host and serve Django projects and I've opted to use Apache2 coupled > > > with mod_wsgi; the only problem is that the mod_wsgi process keeps seg > > > faulting. A note to keep in mind, this is done in a 64-bit > > > environment. > > > > The guide is located > > > here:http://ethics-gradient.blogspot.com/2009/02/django-and-ubuntu-804-chr... > > > > The first issue is, if you simply run this command - "sudo apt-get > > > install apache2 libapache2-mod-wsgi" - in Ubuntu 8.04 the newly > > > restarted Apache process will continuously seg fault. For some reason, > > > the user must manually stop apache, then start it; a simple call to > > > the restart command doesn't work either. > > > > But then, once mod_wsgi is set to load a Django project using the > > > settings noted in the aforementioned guide, each request results in a: > > > "[notice] child pid xxxx exit signal Segmentation fault (11)" > > > > I enabled "LogLevel info" but the additional log messages didn't tell > > > me much: > > > > [info] mod_wsgi (pid=9251): Create interpreter 'test.gen.ki|'. > > > [info] [client 127.0.0.1] mod_wsgi (pid=xxxx, process='gen.ki', > > > application='test.gen.ki|'): Loading WSGI script '/home/django/ > > > domains/ > > > gen.ki/private/apache/genki.wsgi'. > > > [error] [client 127.0.0.1] Premature end of script headers: genki.wsgi > > > [info] mod_wsgi (pid=9270): Attach interpreter ''. > > > [info] mod_wsgi (pid=9270): Enable monitor thread in process 'gen.ki'. > > > [info] mod_wsgi (pid=9270): Enable deadlock thread in process > > > 'gen.ki'. > > > > If you have any insight as to why this might be happening, I would be > > > very grateful if you would be willing to part with it. The guide > > > should provide the necessary information as to how the system is set > > > up, but please ask if there's anything missing. > > > Have you read the documentation, in particular the sections which > > talk about circumstances where crashes can occur. > > http://code.google.com/p/modwsgi/wiki/InstallationIssues > > http://code.google.com/p/modwsgi/wiki/ApplicationIssues > > > Normally the problem is going to be a mismatch in shared library > > versions used by Apache, PHP or some other Apache module and what a > > Python module uses. In some cases the problem can be because of third > > party Python modules not designed to run in sub interpreters. Not > > knowing what your application does and what major Python modules/ > > packages it uses, again makes it harder to guess. > > BTW, in the referenced web page, why are you doing: > > sys.path.append('/usr/lib/python2.5/site-packages') > > This is bad practice and would cause problems if mod_wsgi wasn't > actually using Python 2.5. Thus you should not be telling people to > add that, because they will blindly do it and if they had both Python > 2.4 and 2.5 installed, but mod_wsgi was using Python 2.4, chaos could > ensue, including crashes. > > Graham --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en -~----------~----~----~----~------~----~------~--~---
