Re: Mod_wsgi and Apache Problems - Unhandled request return Internal Server Error / Premature end of script headers

2009-08-08 Thread Graham Dumpleton



On Aug 9, 3:12 pm, Lee  wrote:
> On Aug 8, 5:55 pm, Lee  wrote:
>
>
>
>
>
> > Interesting timing-- I have the same problem.  My basic testing django
> > app loads and works fine, but trying to access the admin causes the
> > seg fault.  Unfortunately I'll have to wait until my sys admin is
> > available on Monday to try Graham's vhost config suggestions...  I'm
> > hoping that fixes it.
>
> > On Aug 8, 6:45 am, Graham Dumpleton 
> > wrote:
>
> > > On Aug 8, 5:22 pm, pcrutch  wrote:
>
> > > > The problem still exists. I added the changes you suggested.
>
> > > > here is my sites-available file
> > > > 
>
> > > >    
> > > >         ServerName dragonfly.cens.ucla.edu
>
> > > >   WSGIDaemonProcess dragonfly.cens.ucla.edu processes=4 threads=1
> > > >    WSGIApplicationGroup %{GLOBAL}
> > > >    WSGIProcessGroup dragonfly.cens.ucla.edu
>
> > > >         WSGIScriptAlias / /home/patrick/geodj/apache/sitez.wsgi
> > > >         
> > > >             Order deny,allow
> > > >             Allow from all
> > > >         
>
> > > >         ErrorLog /var/log/apache2/error.log
> > > >         LogLevel warn
>
> > > >         CustomLog /var/log/apache2/access.log combined
> > > >     
>
> > > > -
> > > > sites-enabled file
>
> > > > 
> > > >     #Basic setup
> > > >     ServerAdmin pcrutc...@ucla.edu
> > > >     ServerName dragonfly.cens.ucla.edu
> > > >     ServerAlias dragonfly.cens.ucla.edu
>
> > > >     
> > > >         Order deny,allow
> > > >         Allow from all
> > > >     
>
> > > Safer to use:
>
> > >      
> > >          Order deny,allow
> > >          Allow from all
> > >      
>
> > > >     LogLevel warn
> > > >     ErrorLog  /home/patrick/geodj/apache_error.log
> > > >     CustomLog /home/patrick/geodj/apache_access.log combined
>
> > > >    WSGIDaemonProcess dragonfly.cens.ucla.edu processes=4 threads=1
> > > >    WSGIApplicationGroup %{GLOBAL}
> > > >    WSGIProcessGroup dragonfly.cens.ucla.edu
>
> > > >     WSGIScriptAlias / /home/patrick/geodj/apache/sitez.wsgi
> > > > 
>
> > > Why are sites-available and sites-enabled different. If I understand
> > > what you are talking about, one should be a file and the other a
> > > symlink to the first file. Thus they should be exactly the same. Thus
> > > how you are configuring your Apache isn't normal. You should fix that
> > > up.
>
> > > The configuration themselves look fine. If you had truly done a full
> > > stop of Apache and then started it again, should pick up
> > > configuration. If still have crashes, then try and hello world program
> > > in place of you Django installation and make sure that your mod_wsgi
> > > installation is running properly. See:
>
> > >  http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
>
> > > If even that crashes, then likely you are using mod_python at same
> > > time and it is causing crashes. See:
>
> > >  http://code.google.com/p/modwsgi/wiki/InstallationIssues
>
> > > If hello world works, but not Django, then and application is being
> > > forced to main interpreter and single threaded, likely you have a
> > > shared version library mismatch. This can occur with expat, MySQL and
> > > other libraries. Have a good read through:
>
> > >  http://code.google.com/p/modwsgi/wiki/ApplicationIssues
>
> > > Also read through:
>
> > >  http://code.google.com/p/modwsgi/wiki/DebuggingTechniques
>
> > > Worst case you will need to use debugger as detailed in last part of
> > > that to debug problem.
>
> > > BTW, you really also need to provide more context from log file rather
> > > than just that single line. Show what happened before and after that
> > > point in log file. Also check main Apache error log to see if you are
> > > getting segmentation fault messages.
>
> > > Graham
>
> > > > -
> > > > my project .wsgi file
>
> > > > import os, sys
> > > > sys.path.append('/home/patrick/geodj')
> > > > sys.path.append('/home/patrick/geodj/templates')
>
> > > > os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
>
> > > > import django.core.handlers.wsgi
>
> > > > application = django.core.handlers.wsgi.WSGIHandler()
>
> > > > On Aug 6, 4:54 pm, Graham Dumpleton 
> > > > wrote:
>
> > > > > On Aug 7, 7:43 am, pcrutch  wrote:
>
> > > > > > So I run the dev server for my project and everything comes up fine,
> > > > > > map shows properly and loads the data correctly. However, using wsgi
> > > > > > the map loads and gives " Unhandled request return Internal Server
> > > > > > Error" and I checked the log file and I have the " premature end of
> > > > > > script headers" error. I have no clue why it won't load the data on
> > > > > > the map properly.
>
> > > > > > here is my sites-available file
> > > > > > 
>
> > > > > >    
> > > > > >         ServerName dragonfly.cens.ucla.edu
>
> > > > > >         WSGIDaemonProcess dragonfly.cens.ucla.edu threads=25
> > > > > >         WSGIProcessGroup dragonfly.cens.ucla.edu
>
> > > > > >         WSGIScriptAlias / /home/patrick/geodj/apache/sitez.wsgi
> > > > > >        

Re: Mod_wsgi and Apache Problems - Unhandled request return Internal Server Error / Premature end of script headers

2009-08-08 Thread Lee

On Aug 8, 5:55 pm, Lee  wrote:
> Interesting timing-- I have the same problem.  My basic testing django
> app loads and works fine, but trying to access the admin causes the
> seg fault.  Unfortunately I'll have to wait until my sys admin is
> available on Monday to try Graham's vhost config suggestions...  I'm
> hoping that fixes it.
>
> On Aug 8, 6:45 am, Graham Dumpleton 
> wrote:
>
> > On Aug 8, 5:22 pm, pcrutch  wrote:
>
> > > The problem still exists. I added the changes you suggested.
>
> > > here is my sites-available file
> > > 
>
> > >    
> > >         ServerName dragonfly.cens.ucla.edu
>
> > >   WSGIDaemonProcess dragonfly.cens.ucla.edu processes=4 threads=1
> > >    WSGIApplicationGroup %{GLOBAL}
> > >    WSGIProcessGroup dragonfly.cens.ucla.edu
>
> > >         WSGIScriptAlias / /home/patrick/geodj/apache/sitez.wsgi
> > >         
> > >             Order deny,allow
> > >             Allow from all
> > >         
>
> > >         ErrorLog /var/log/apache2/error.log
> > >         LogLevel warn
>
> > >         CustomLog /var/log/apache2/access.log combined
> > >     
>
> > > -
> > > sites-enabled file
>
> > > 
> > >     #Basic setup
> > >     ServerAdmin pcrutc...@ucla.edu
> > >     ServerName dragonfly.cens.ucla.edu
> > >     ServerAlias dragonfly.cens.ucla.edu
>
> > >     
> > >         Order deny,allow
> > >         Allow from all
> > >     
>
> > Safer to use:
>
> >      
> >          Order deny,allow
> >          Allow from all
> >      
>
> > >     LogLevel warn
> > >     ErrorLog  /home/patrick/geodj/apache_error.log
> > >     CustomLog /home/patrick/geodj/apache_access.log combined
>
> > >    WSGIDaemonProcess dragonfly.cens.ucla.edu processes=4 threads=1
> > >    WSGIApplicationGroup %{GLOBAL}
> > >    WSGIProcessGroup dragonfly.cens.ucla.edu
>
> > >     WSGIScriptAlias / /home/patrick/geodj/apache/sitez.wsgi
> > > 
>
> > Why are sites-available and sites-enabled different. If I understand
> > what you are talking about, one should be a file and the other a
> > symlink to the first file. Thus they should be exactly the same. Thus
> > how you are configuring your Apache isn't normal. You should fix that
> > up.
>
> > The configuration themselves look fine. If you had truly done a full
> > stop of Apache and then started it again, should pick up
> > configuration. If still have crashes, then try and hello world program
> > in place of you Django installation and make sure that your mod_wsgi
> > installation is running properly. See:
>
> >  http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
>
> > If even that crashes, then likely you are using mod_python at same
> > time and it is causing crashes. See:
>
> >  http://code.google.com/p/modwsgi/wiki/InstallationIssues
>
> > If hello world works, but not Django, then and application is being
> > forced to main interpreter and single threaded, likely you have a
> > shared version library mismatch. This can occur with expat, MySQL and
> > other libraries. Have a good read through:
>
> >  http://code.google.com/p/modwsgi/wiki/ApplicationIssues
>
> > Also read through:
>
> >  http://code.google.com/p/modwsgi/wiki/DebuggingTechniques
>
> > Worst case you will need to use debugger as detailed in last part of
> > that to debug problem.
>
> > BTW, you really also need to provide more context from log file rather
> > than just that single line. Show what happened before and after that
> > point in log file. Also check main Apache error log to see if you are
> > getting segmentation fault messages.
>
> > Graham
>
> > > -
> > > my project .wsgi file
>
> > > import os, sys
> > > sys.path.append('/home/patrick/geodj')
> > > sys.path.append('/home/patrick/geodj/templates')
>
> > > os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
>
> > > import django.core.handlers.wsgi
>
> > > application = django.core.handlers.wsgi.WSGIHandler()
>
> > > On Aug 6, 4:54 pm, Graham Dumpleton 
> > > wrote:
>
> > > > On Aug 7, 7:43 am, pcrutch  wrote:
>
> > > > > So I run the dev server for my project and everything comes up fine,
> > > > > map shows properly and loads the data correctly. However, using wsgi
> > > > > the map loads and gives " Unhandled request return Internal Server
> > > > > Error" and I checked the log file and I have the " premature end of
> > > > > script headers" error. I have no clue why it won't load the data on
> > > > > the map properly.
>
> > > > > here is my sites-available file
> > > > > 
>
> > > > >    
> > > > >         ServerName dragonfly.cens.ucla.edu
>
> > > > >         WSGIDaemonProcess dragonfly.cens.ucla.edu threads=25
> > > > >         WSGIProcessGroup dragonfly.cens.ucla.edu
>
> > > > >         WSGIScriptAlias / /home/patrick/geodj/apache/sitez.wsgi
> > > > >         
> > > > >             Order deny,allow
> > > > >             Allow from all
> > > > >         
>
> > > > >         ErrorLog /var/log/apache2/error.log
> > > > >         LogLevel warn
>
> > > > >         CustomLog /var/log/apache2/access.log combin

Re: Mod_wsgi and Apache Problems - Unhandled request return Internal Server Error / Premature end of script headers

2009-08-08 Thread Lee

Interesting timing-- I have the same problem.  My basic testing django
app loads and works fine, but trying to access the admin causes the
seg fault.  Unfortunately I'll have to wait until my sys admin is
available on Monday to try Graham's vhost config suggestions...  I'm
hoping that fixes it.

On Aug 8, 6:45 am, Graham Dumpleton 
wrote:
> On Aug 8, 5:22 pm, pcrutch  wrote:
>
>
>
> > The problem still exists. I added the changes you suggested.
>
> > here is my sites-available file
> > 
>
> >    
> >         ServerName dragonfly.cens.ucla.edu
>
> >   WSGIDaemonProcess dragonfly.cens.ucla.edu processes=4 threads=1
> >    WSGIApplicationGroup %{GLOBAL}
> >    WSGIProcessGroup dragonfly.cens.ucla.edu
>
> >         WSGIScriptAlias / /home/patrick/geodj/apache/sitez.wsgi
> >         
> >             Order deny,allow
> >             Allow from all
> >         
>
> >         ErrorLog /var/log/apache2/error.log
> >         LogLevel warn
>
> >         CustomLog /var/log/apache2/access.log combined
> >     
>
> > -
> > sites-enabled file
>
> > 
> >     #Basic setup
> >     ServerAdmin pcrutc...@ucla.edu
> >     ServerName dragonfly.cens.ucla.edu
> >     ServerAlias dragonfly.cens.ucla.edu
>
> >     
> >         Order deny,allow
> >         Allow from all
> >     
>
> Safer to use:
>
>      
>          Order deny,allow
>          Allow from all
>      
>
> >     LogLevel warn
> >     ErrorLog  /home/patrick/geodj/apache_error.log
> >     CustomLog /home/patrick/geodj/apache_access.log combined
>
> >    WSGIDaemonProcess dragonfly.cens.ucla.edu processes=4 threads=1
> >    WSGIApplicationGroup %{GLOBAL}
> >    WSGIProcessGroup dragonfly.cens.ucla.edu
>
> >     WSGIScriptAlias / /home/patrick/geodj/apache/sitez.wsgi
> > 
>
> Why are sites-available and sites-enabled different. If I understand
> what you are talking about, one should be a file and the other a
> symlink to the first file. Thus they should be exactly the same. Thus
> how you are configuring your Apache isn't normal. You should fix that
> up.
>
> The configuration themselves look fine. If you had truly done a full
> stop of Apache and then started it again, should pick up
> configuration. If still have crashes, then try and hello world program
> in place of you Django installation and make sure that your mod_wsgi
> installation is running properly. See:
>
>  http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
>
> If even that crashes, then likely you are using mod_python at same
> time and it is causing crashes. See:
>
>  http://code.google.com/p/modwsgi/wiki/InstallationIssues
>
> If hello world works, but not Django, then and application is being
> forced to main interpreter and single threaded, likely you have a
> shared version library mismatch. This can occur with expat, MySQL and
> other libraries. Have a good read through:
>
>  http://code.google.com/p/modwsgi/wiki/ApplicationIssues
>
> Also read through:
>
>  http://code.google.com/p/modwsgi/wiki/DebuggingTechniques
>
> Worst case you will need to use debugger as detailed in last part of
> that to debug problem.
>
> BTW, you really also need to provide more context from log file rather
> than just that single line. Show what happened before and after that
> point in log file. Also check main Apache error log to see if you are
> getting segmentation fault messages.
>
> Graham
>
> > -
> > my project .wsgi file
>
> > import os, sys
> > sys.path.append('/home/patrick/geodj')
> > sys.path.append('/home/patrick/geodj/templates')
>
> > os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
>
> > import django.core.handlers.wsgi
>
> > application = django.core.handlers.wsgi.WSGIHandler()
>
> > On Aug 6, 4:54 pm, Graham Dumpleton 
> > wrote:
>
> > > On Aug 7, 7:43 am, pcrutch  wrote:
>
> > > > So I run the dev server for my project and everything comes up fine,
> > > > map shows properly and loads the data correctly. However, using wsgi
> > > > the map loads and gives " Unhandled request return Internal Server
> > > > Error" and I checked the log file and I have the " premature end of
> > > > script headers" error. I have no clue why it won't load the data on
> > > > the map properly.
>
> > > > here is my sites-available file
> > > > 
>
> > > >    
> > > >         ServerName dragonfly.cens.ucla.edu
>
> > > >         WSGIDaemonProcess dragonfly.cens.ucla.edu threads=25
> > > >         WSGIProcessGroup dragonfly.cens.ucla.edu
>
> > > >         WSGIScriptAlias / /home/patrick/geodj/apache/sitez.wsgi
> > > >         
> > > >             Order deny,allow
> > > >             Allow from all
> > > >         
>
> > > >         ErrorLog /var/log/apache2/error.log
> > > >         LogLevel warn
>
> > > >         CustomLog /var/log/apache2/access.log combined
> > > >     
>
> > > > -
> > > > sites-enabled file
>
> > > > 
> > > >     #Basic setup
> > > >     ServerAdmin pcrutc...@ucla.edu
> > > >     ServerName dragonfly.cens.ucla.edu
> > > >     ServerAlias dragonfly.cens.ucla.edu
>
> > > >    

Re: Mod_wsgi and Apache Problems - Unhandled request return Internal Server Error / Premature end of script headers

2009-08-08 Thread Graham Dumpleton



On Aug 8, 5:22 pm, pcrutch  wrote:
> The problem still exists. I added the changes you suggested.
>
> here is my sites-available file
> 
>
>    
>         ServerName dragonfly.cens.ucla.edu
>
>   WSGIDaemonProcess dragonfly.cens.ucla.edu processes=4 threads=1
>    WSGIApplicationGroup %{GLOBAL}
>    WSGIProcessGroup dragonfly.cens.ucla.edu
>
>         WSGIScriptAlias / /home/patrick/geodj/apache/sitez.wsgi
>         
>             Order deny,allow
>             Allow from all
>         
>
>         ErrorLog /var/log/apache2/error.log
>         LogLevel warn
>
>         CustomLog /var/log/apache2/access.log combined
>     
>
> -
> sites-enabled file
>
> 
>     #Basic setup
>     ServerAdmin pcrutc...@ucla.edu
>     ServerName dragonfly.cens.ucla.edu
>     ServerAlias dragonfly.cens.ucla.edu
>
>     
>         Order deny,allow
>         Allow from all
>     

Safer to use:

 
 Order deny,allow
 Allow from all
 

>     LogLevel warn
>     ErrorLog  /home/patrick/geodj/apache_error.log
>     CustomLog /home/patrick/geodj/apache_access.log combined
>
>    WSGIDaemonProcess dragonfly.cens.ucla.edu processes=4 threads=1
>    WSGIApplicationGroup %{GLOBAL}
>    WSGIProcessGroup dragonfly.cens.ucla.edu
>
>     WSGIScriptAlias / /home/patrick/geodj/apache/sitez.wsgi
> 

Why are sites-available and sites-enabled different. If I understand
what you are talking about, one should be a file and the other a
symlink to the first file. Thus they should be exactly the same. Thus
how you are configuring your Apache isn't normal. You should fix that
up.

The configuration themselves look fine. If you had truly done a full
stop of Apache and then started it again, should pick up
configuration. If still have crashes, then try and hello world program
in place of you Django installation and make sure that your mod_wsgi
installation is running properly. See:

  http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide

If even that crashes, then likely you are using mod_python at same
time and it is causing crashes. See:

  http://code.google.com/p/modwsgi/wiki/InstallationIssues

If hello world works, but not Django, then and application is being
forced to main interpreter and single threaded, likely you have a
shared version library mismatch. This can occur with expat, MySQL and
other libraries. Have a good read through:

  http://code.google.com/p/modwsgi/wiki/ApplicationIssues

Also read through:

  http://code.google.com/p/modwsgi/wiki/DebuggingTechniques

Worst case you will need to use debugger as detailed in last part of
that to debug problem.

BTW, you really also need to provide more context from log file rather
than just that single line. Show what happened before and after that
point in log file. Also check main Apache error log to see if you are
getting segmentation fault messages.

Graham

> -
> my project .wsgi file
>
> import os, sys
> sys.path.append('/home/patrick/geodj')
> sys.path.append('/home/patrick/geodj/templates')
>
> os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
>
> import django.core.handlers.wsgi
>
> application = django.core.handlers.wsgi.WSGIHandler()
>
> On Aug 6, 4:54 pm, Graham Dumpleton 
> wrote:
>
>
>
> > On Aug 7, 7:43 am, pcrutch  wrote:
>
> > > So I run the dev server for my project and everything comes up fine,
> > > map shows properly and loads the data correctly. However, using wsgi
> > > the map loads and gives " Unhandled request return Internal Server
> > > Error" and I checked the log file and I have the " premature end of
> > > script headers" error. I have no clue why it won't load the data on
> > > the map properly.
>
> > > here is my sites-available file
> > > 
>
> > >    
> > >         ServerName dragonfly.cens.ucla.edu
>
> > >         WSGIDaemonProcess dragonfly.cens.ucla.edu threads=25
> > >         WSGIProcessGroup dragonfly.cens.ucla.edu
>
> > >         WSGIScriptAlias / /home/patrick/geodj/apache/sitez.wsgi
> > >         
> > >             Order deny,allow
> > >             Allow from all
> > >         
>
> > >         ErrorLog /var/log/apache2/error.log
> > >         LogLevel warn
>
> > >         CustomLog /var/log/apache2/access.log combined
> > >     
>
> > > -
> > > sites-enabled file
>
> > > 
> > >     #Basic setup
> > >     ServerAdmin pcrutc...@ucla.edu
> > >     ServerName dragonfly.cens.ucla.edu
> > >     ServerAlias dragonfly.cens.ucla.edu
>
> > >     
> > >         Order deny,allow
> > >         Allow from all
> > >     
>
> > >     LogLevel warn
> > >     ErrorLog  /home/patrick/geodj/apache_error.log
> > >     CustomLog /home/patrick/geodj/apache_access.log combined
>
> > >     WSGIDaemonProcess dragonfly.cens.ucla.edu threads=25
> > >     WSGIProcessGroup dragonfly.cens.ucla.edu
>
> > >     WSGIScriptAlias / /home/patrick/geodj/apache/sitez.wsgi
> > > 
>
> > > -
> > > my project .wsgi file
>
> > > import os, sys
> > > sys.path.append('/home/patrick/geodj')
> > > sys.path.append('/home/patrick/geodj/templa

Re: Mod_wsgi and Apache Problems - Unhandled request return Internal Server Error / Premature end of script headers

2009-08-08 Thread pcrutch

The problem still exists. I added the changes you suggested.

here is my sites-available file


   
ServerName dragonfly.cens.ucla.edu

  WSGIDaemonProcess dragonfly.cens.ucla.edu processes=4 threads=1
   WSGIApplicationGroup %{GLOBAL}
   WSGIProcessGroup dragonfly.cens.ucla.edu


WSGIScriptAlias / /home/patrick/geodj/apache/sitez.wsgi

Order deny,allow
Allow from all


ErrorLog /var/log/apache2/error.log
LogLevel warn

CustomLog /var/log/apache2/access.log combined


-
sites-enabled file


#Basic setup
ServerAdmin pcrutc...@ucla.edu
ServerName dragonfly.cens.ucla.edu
ServerAlias dragonfly.cens.ucla.edu


Order deny,allow
Allow from all


LogLevel warn
ErrorLog  /home/patrick/geodj/apache_error.log
CustomLog /home/patrick/geodj/apache_access.log combined

   WSGIDaemonProcess dragonfly.cens.ucla.edu processes=4 threads=1
   WSGIApplicationGroup %{GLOBAL}
   WSGIProcessGroup dragonfly.cens.ucla.edu

WSGIScriptAlias / /home/patrick/geodj/apache/sitez.wsgi


-
my project .wsgi file

import os, sys
sys.path.append('/home/patrick/geodj')
sys.path.append('/home/patrick/geodj/templates')

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

import django.core.handlers.wsgi

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

On Aug 6, 4:54 pm, Graham Dumpleton 
wrote:
> On Aug 7, 7:43 am, pcrutch  wrote:
>
>
>
> > So I run the dev server for my project and everything comes up fine,
> > map shows properly and loads the data correctly. However, using wsgi
> > the map loads and gives " Unhandled request return Internal Server
> > Error" and I checked the log file and I have the " premature end of
> > script headers" error. I have no clue why it won't load the data on
> > the map properly.
>
> > here is my sites-available file
> > 
>
> >    
> >         ServerName dragonfly.cens.ucla.edu
>
> >         WSGIDaemonProcess dragonfly.cens.ucla.edu threads=25
> >         WSGIProcessGroup dragonfly.cens.ucla.edu
>
> >         WSGIScriptAlias / /home/patrick/geodj/apache/sitez.wsgi
> >         
> >             Order deny,allow
> >             Allow from all
> >         
>
> >         ErrorLog /var/log/apache2/error.log
> >         LogLevel warn
>
> >         CustomLog /var/log/apache2/access.log combined
> >     
>
> > -
> > sites-enabled file
>
> > 
> >     #Basic setup
> >     ServerAdmin pcrutc...@ucla.edu
> >     ServerName dragonfly.cens.ucla.edu
> >     ServerAlias dragonfly.cens.ucla.edu
>
> >     
> >         Order deny,allow
> >         Allow from all
> >     
>
> >     LogLevel warn
> >     ErrorLog  /home/patrick/geodj/apache_error.log
> >     CustomLog /home/patrick/geodj/apache_access.log combined
>
> >     WSGIDaemonProcess dragonfly.cens.ucla.edu threads=25
> >     WSGIProcessGroup dragonfly.cens.ucla.edu
>
> >     WSGIScriptAlias / /home/patrick/geodj/apache/sitez.wsgi
> > 
>
> > -
> > my project .wsgi file
>
> > import os, sys
> > sys.path.append('/home/patrick/geodj')
> > sys.path.append('/home/patrick/geodj/templates')
>
> > os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
>
> > import django.core.handlers.wsgi
>
> > application = django.core.handlers.wsgi.WSGIHandler()
>
> > What gives?
>
> Since you have 'geodj' and going to guess you are using GeoDjango.
>
> GeoDjango is either not thread safe, or uses a C extension module
> which isn't safe to use in sub interpreters, I don't remember which.
>
> Use:
>
>   WSGIDaemonProcess dragonfly.cens.ucla.edu processes=4 threads=1
>   WSGIApplicationGroup %{GLOBAL}
>
> That is, use single thread daemon processes and force it to run in
> main interpreter.
>
> So, change the WSGIDaemonProcess directive and add
> WSGIApplicationGroup. Leave other directives as is.
>
> Graham
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Mod_wsgi and Apache Problems - Unhandled request return Internal Server Error / Premature end of script headers

2009-08-06 Thread Graham Dumpleton



On Aug 7, 7:43 am, pcrutch  wrote:
> So I run the dev server for my project and everything comes up fine,
> map shows properly and loads the data correctly. However, using wsgi
> the map loads and gives " Unhandled request return Internal Server
> Error" and I checked the log file and I have the " premature end of
> script headers" error. I have no clue why it won't load the data on
> the map properly.
>
> here is my sites-available file
> 
>
>    
>         ServerName dragonfly.cens.ucla.edu
>
>         WSGIDaemonProcess dragonfly.cens.ucla.edu threads=25
>         WSGIProcessGroup dragonfly.cens.ucla.edu
>
>         WSGIScriptAlias / /home/patrick/geodj/apache/sitez.wsgi
>         
>             Order deny,allow
>             Allow from all
>         
>
>         ErrorLog /var/log/apache2/error.log
>         LogLevel warn
>
>         CustomLog /var/log/apache2/access.log combined
>     
>
> -
> sites-enabled file
>
> 
>     #Basic setup
>     ServerAdmin pcrutc...@ucla.edu
>     ServerName dragonfly.cens.ucla.edu
>     ServerAlias dragonfly.cens.ucla.edu
>
>     
>         Order deny,allow
>         Allow from all
>     
>
>     LogLevel warn
>     ErrorLog  /home/patrick/geodj/apache_error.log
>     CustomLog /home/patrick/geodj/apache_access.log combined
>
>     WSGIDaemonProcess dragonfly.cens.ucla.edu threads=25
>     WSGIProcessGroup dragonfly.cens.ucla.edu
>
>     WSGIScriptAlias / /home/patrick/geodj/apache/sitez.wsgi
> 
>
> -
> my project .wsgi file
>
> import os, sys
> sys.path.append('/home/patrick/geodj')
> sys.path.append('/home/patrick/geodj/templates')
>
> os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
>
> import django.core.handlers.wsgi
>
> application = django.core.handlers.wsgi.WSGIHandler()
>
> What gives?

Since you have 'geodj' and going to guess you are using GeoDjango.

GeoDjango is either not thread safe, or uses a C extension module
which isn't safe to use in sub interpreters, I don't remember which.

Use:

  WSGIDaemonProcess dragonfly.cens.ucla.edu processes=4 threads=1
  WSGIApplicationGroup %{GLOBAL}

That is, use single thread daemon processes and force it to run in
main interpreter.

So, change the WSGIDaemonProcess directive and add
WSGIApplicationGroup. Leave other directives as is.

Graham
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---