[modwsgi] Re: Error uploading files: IOError: request data read error

2010-04-21 Thread Jake
I've found out I can update apache and stay on the media temple UOP,
so I'll do that shortly and test again.
Thanks

On Apr 21, 3:19 pm, Jake jakecro...@gmail.com wrote:
 I've setup the WSGI debugging app, and when I try to get a page it
 shows me the headers. However when I submit the upload form I get
 firefox saying The connection to the server was reset while the page
 was loading. The same as I usually get, but Django usually emails me
 an exception and traceback.

 In firebug (without the WSGI debugging app in place) When I copy
 response or request headers, I get nothing.

 I hope that is useful information. I'm at a loss to explain it.

 As for apache, I'm reluctant to upgrade because of the Media Temple
 Update Option Program*. However I'll look into it now, if my apache is
 that old, then perhaps the UOP is not that useful.

 *http://kb.mediatemple.net/questions/97/FAQ:+Update+Option+Program+
 (UOP)

 On Apr 21, 10:58 am, Graham Dumpleton graham.dumple...@gmail.com
 wrote:





  On 21 April 2010 08:51, Jake jakecro...@gmail.com wrote:

   I'm getting a request data read error when trying to upload files to
   the Django admin interface.

   Files under about 150k work, but bigger files always fail and almost
   always at around 200k. The Exception I get is below.

   File /usr/lib/python2.4/site-packages/django/http/
   multipartparser.py, line 405, in read
     return self._file.read(num_bytes)
   IOError: request data read error

   I'm running python 2.4, django 1.1, apache 2.2.3, mod_wsgi 2.8, on
   CentOS (a media temple DV server)
   I've tried Chrome and Firefox on Windows and Firefox on Mac - Same
   results.
   I've tried wsgi daemon mode and embedded
   I can upload to other sites so I don't think it's my connection.
   Locally it's fine (Django development server)

   Everything I've found on this error says it's a mod_python issue and
   that changing to mod_wsgi will fix it, but I am running mod_wsgi.
   Can anyone help?

  Use recipe in:

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

  to capture the WSGI environment as passed to the WSGI application and
  post it for analysis.

  Use FireBug in Firefox to capture the headers sent by the browser for
  the upload and post it for analysis.

  Try installing most recent Apache 2.2.X instead of the old version you
  are using in case it is all because of using old Apache. Especially do
  this as mostly pointless exercise debugging it if not using most up to
  date Apache.

  Graham

  --
  You received this message because you are subscribed to the Google Groups 
  modwsgi group.
  To post to this group, send email to modw...@googlegroups.com.
  To unsubscribe from this group, send email to 
  modwsgi+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/modwsgi?hl=en.

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@googlegroups.com.
 To unsubscribe from this group, send email to 
 modwsgi+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/modwsgi?hl=en.

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



[modwsgi] Re: AppError: Bad response: 404 Not Found (not 200 OK or 3xx redirect for /)

2010-04-21 Thread noisebleed
Hi Graham.

I'm not sure what should I post about your URL mapping question.
I've searched the application and found nothing really useful. I do
know that TG2 is based on Pylons so I guess it uses the Pylons way.

Don't know if it helps but the same app is working with paster serve
on the personal machine. To test it I'm using http://localhost:8080.

Sorry for my lack of knowledge but I'm fairly new to web development
in Python.

If you have suggestion for debugging this issue I would be glad to try
it.

Regards,
  Vitor (noisebleed)

On 21 Abr, 03:29, Graham Dumpleton graham.dumple...@gmail.com wrote:
 On 21 April 2010 00:42, noisebleed vitorbrandao...@gmail.com wrote:



  Hi all. First message sent to modwsgi mailing list.

  I've built a small web application with TurboGears2 and tested it
  inside a virtualenv (on my personal machine) with paster serve
  development.ini. Works just fine.

  Then I built an Egg and installed system-wide on my server. Defined a
  new Apache2 vhost and configured both Apache and the wsgi script
  created by modwsgideploy. After some adjustments I'm stuck with the
  message in the email subject. When visiting my URL Apache shows 500
  Internal Server Error.

  Here goes an excerpt from Apache error log:

  [info] Initial (No.1) HTTPS request received for child 1 (server
  gatekeeper.localhost:443)
  [info] mod_wsgi (pid=21618): Create interpreter 'gatekeeper.localhost:
  5|'.
  [info] [client 192.168.1.103] mod_wsgi (pid=21618,
  process='gatekeeper', application='gatekeeper.localhost:5|'):
  Loading WSGI script '/var/www/modwsgi/gatekeeper/
  gatekeeper.wsgi'.
  [error] 15:54:44,649 DEBUG [pylons.configuration] Initializing
  configuration, package:
  'gatekeeper'
  [error] 15:54:44,651 DEBUG [pylons.configuration] Pushing process
  configuration
  [error] 15:54:44,681 DEBUG [pylons.configuration] Adding mako engine
  with alias None and {'mako.directories': ['/usr/lib/python2.6/site-
  packages/GateKeeper-0.1dev-py2.6.egg/gatekeeper/templates'],
  'myghty.component_root': [{'templates': '/usr/lib/python2.6/site-
  packages/GateKeeper-0.1dev-py2.6.egg/gatekeeper/templates'}],
  'myghty.data_dir': '/var/www/modwsgi/gatekeeper/data/templates',
  'kid.encoding': 'utf-8', 'kid.assume_encoding': 'utf-8',
  'mako.module_directory': '/var/www/modwsgi/gatekeeper/data/templates',
  'myghty.allow_globals': ['c', 'config', 'g', 'h', 'render', 'request',
  'session', 'translator', 'ungettext', '_', 'N_'],
  'myghty.output_encoding': 'utf-8', 'myghty.raise_error': True,
  'mako.output_encoding': 'utf-8', 'mako.filesystem_checks': True}
  options
  [error] 15:54:44,682 DEBUG [pylons.configuration] Loaded mako template
  engine as the default template
  renderer
  [error] 15:54:44,931 DEBUG [pylons.templating] Initialized Buffet
  object
  [error] 15:54:44,933 DEBUG [pylons.templating] Adding mako template
  language for use with
  Buffet
  [error] 15:54:44,934 DEBUG [routes.middleware] Initialized with method
  overriding = True, and path info altering =
  True
  [error] 15:54:45,025 DEBUG [txn.-1335477392] new
  transaction
  [error] 15:54:45,035 DEBUG [routes.middleware] Matched
  GET /
  [error] 15:54:45,036 DEBUG [routes.middleware] Route path: '*url',
  defaults: {'action': u'routes_placeholder', 'controller':
  u'root'}
  [error] 15:54:45,037 DEBUG [routes.middleware] Match dict: {'url':
  u'/', 'action': u'routes_placeholder', 'controller':
  u'root'}
  [error] 15:54:45,038 DEBUG [pylons.wsgiapp] Setting up Pylons stacked
  object
  globals
  [error] 15:54:45,040 DEBUG [pylons.wsgiapp] Setting up paste testing
  environment
  variables
  [error] 15:54:45,041 DEBUG [pylons.wsgiapp] Resolved URL to
  controller:
  u'root'
  [error] 15:54:45,088 DEBUG [tw.core.resources] Registered static at /
  tw.forms/
  static
  [error] 15:54:45,092 DEBUG [tw.core.resources] Registered static/
  calendar at /tw.forms/static/
  calendar
  [error] 15:54:45,183 DEBUG [tg.wsgiapp] Found controller, module:
  'gatekeeper.controllers.root', class:
  'RootController'
  [error] 15:54:45,184 DEBUG [pylons.wsgiapp] Controller appears to be a
  class, instantiating

  (...)

  [error] 15:54:45,192 INFO  [tg.i18n] Set request language to
  []
  [error] 15:54:45,194 INFO  [tg.i18n] Language []: not supported by
  FormEncode
  [error] 15:54:45,195 DEBUG [tg.controllers] No controller-wide
  authorization
  at /
  [error] 15:54:45,198 DEBUG [pylons.controllers.core] Merging
  pylons.response headers into start_response call, status: 404 Not
  Found
  [error] 15:54:45,201 DEBUG [txn.-1335477392]
  commit
  [error] 15:54:45,202 DEBUG [tg.configuration] Removing DBSession from
  current
  thread
  [error] 15:54:45,203 DEBUG [txn.-1335477392] new
  transaction
  [error] 15:54:45,208 DEBUG [routes.middleware] Matched GET /error/
  document
  [error] 15:54:45,209 DEBUG [routes.middleware] Route path: '*url',
  defaults: {'action': u'routes_placeholder', 'controller':
  u'root'}
  [error] 15:54:45,210 

Re: [modwsgi] Re: AppError: Bad response: 404 Not Found (not 200 OK or 3xx redirect for /)

2010-04-21 Thread Graham Dumpleton
On 21 April 2010 22:34, noisebleed vitorbrandao...@gmail.com wrote:
 Hi Graham.

 I'm not sure what should I post about your URL mapping question.
 I've searched the application and found nothing really useful. I do
 know that TG2 is based on Pylons so I guess it uses the Pylons way.

 Don't know if it helps but the same app is working with paster serve
 on the personal machine. To test it I'm using http://localhost:8080.

 Sorry for my lack of knowledge but I'm fairly new to web development
 in Python.

It isn't your fault. The problem is that 'paster serve' does
additional setup of the process environment and application beyond
what 'loadapp' by itself does. Given that recipes for using an
alternate WSGI server often only talk about loadapp and not what else
has to be done, you cant replicate the setup in the same way and this
is why you get differences like you are encountering between paste
server and other hosting methods. Same sort of problem occurs in other
frameworks as well when trying to move from their builtin development
servers to other hosting mechanism. It all really sucks and the base
framework developers seem to not usually care much about making it
easier by providing single object entry points that do everything that
the internal web servers do.

That said, TG setup instructions I have seen have been reasonably good
at capturing these extra hidden steps. The question is why one of
these steps they note, which is the app.get() isn't working.

Can you perhaps try:

  app.get()

and see if it makes a difference. It may be something to do with
trailing slash where something is handling single slash differently.

Graham

 If you have suggestion for debugging this issue I would be glad to try
 it.

 Regards,
  Vitor (noisebleed)

 On 21 Abr, 03:29, Graham Dumpleton graham.dumple...@gmail.com wrote:
 On 21 April 2010 00:42, noisebleed vitorbrandao...@gmail.com wrote:



  Hi all. First message sent to modwsgi mailing list.

  I've built a small web application with TurboGears2 and tested it
  inside a virtualenv (on my personal machine) with paster serve
  development.ini. Works just fine.

  Then I built an Egg and installed system-wide on my server. Defined a
  new Apache2 vhost and configured both Apache and the wsgi script
  created by modwsgideploy. After some adjustments I'm stuck with the
  message in the email subject. When visiting my URL Apache shows 500
  Internal Server Error.

  Here goes an excerpt from Apache error log:

  [info] Initial (No.1) HTTPS request received for child 1 (server
  gatekeeper.localhost:443)
  [info] mod_wsgi (pid=21618): Create interpreter 'gatekeeper.localhost:
  5|'.
  [info] [client 192.168.1.103] mod_wsgi (pid=21618,
  process='gatekeeper', application='gatekeeper.localhost:5|'):
  Loading WSGI script '/var/www/modwsgi/gatekeeper/
  gatekeeper.wsgi'.
  [error] 15:54:44,649 DEBUG [pylons.configuration] Initializing
  configuration, package:
  'gatekeeper'
  [error] 15:54:44,651 DEBUG [pylons.configuration] Pushing process
  configuration
  [error] 15:54:44,681 DEBUG [pylons.configuration] Adding mako engine
  with alias None and {'mako.directories': ['/usr/lib/python2.6/site-
  packages/GateKeeper-0.1dev-py2.6.egg/gatekeeper/templates'],
  'myghty.component_root': [{'templates': '/usr/lib/python2.6/site-
  packages/GateKeeper-0.1dev-py2.6.egg/gatekeeper/templates'}],
  'myghty.data_dir': '/var/www/modwsgi/gatekeeper/data/templates',
  'kid.encoding': 'utf-8', 'kid.assume_encoding': 'utf-8',
  'mako.module_directory': '/var/www/modwsgi/gatekeeper/data/templates',
  'myghty.allow_globals': ['c', 'config', 'g', 'h', 'render', 'request',
  'session', 'translator', 'ungettext', '_', 'N_'],
  'myghty.output_encoding': 'utf-8', 'myghty.raise_error': True,
  'mako.output_encoding': 'utf-8', 'mako.filesystem_checks': True}
  options
  [error] 15:54:44,682 DEBUG [pylons.configuration] Loaded mako template
  engine as the default template
  renderer
  [error] 15:54:44,931 DEBUG [pylons.templating] Initialized Buffet
  object
  [error] 15:54:44,933 DEBUG [pylons.templating] Adding mako template
  language for use with
  Buffet
  [error] 15:54:44,934 DEBUG [routes.middleware] Initialized with method
  overriding = True, and path info altering =
  True
  [error] 15:54:45,025 DEBUG [txn.-1335477392] new
  transaction
  [error] 15:54:45,035 DEBUG [routes.middleware] Matched
  GET /
  [error] 15:54:45,036 DEBUG [routes.middleware] Route path: '*url',
  defaults: {'action': u'routes_placeholder', 'controller':
  u'root'}
  [error] 15:54:45,037 DEBUG [routes.middleware] Match dict: {'url':
  u'/', 'action': u'routes_placeholder', 'controller':
  u'root'}
  [error] 15:54:45,038 DEBUG [pylons.wsgiapp] Setting up Pylons stacked
  object
  globals
  [error] 15:54:45,040 DEBUG [pylons.wsgiapp] Setting up paste testing
  environment
  variables
  [error] 15:54:45,041 DEBUG [pylons.wsgiapp] Resolved URL to
  controller:
  u'root'
  [error] 15:54:45,088 DEBUG 

[modwsgi] Re: AppError: Bad response: 404 Not Found (not 200 OK or 3xx redirect for /)

2010-04-21 Thread noisebleed
Hi again.

First, thanks for the insight about these deployment issues.

About your suggestion now Apache is throwing 404 Not Found instead of
500 Internal Server Error and I see something like this in the log:
[error] 14:28:12,102 DEBUG [tg.controllers] No controller-wide
authorization at /
[error] 14:28:12,105 DEBUG [pylons.controllers.core] Merging
pylons.response headers into start_response call, status: 404 Not
Found
[error] 14:28:12,108 DEBUG [txn.-1333920912] commit
[error] 14:28:12,109 DEBUG [tg.configuration] Removing DBSession from
current thread

Any ideas?

Vitor (noisebleed)

On 21 Abr, 13:45, Graham Dumpleton graham.dumple...@gmail.com wrote:
 On 21 April 2010 22:34, noisebleed vitorbrandao...@gmail.com wrote:

  Hi Graham.

  I'm not sure what should I post about your URL mapping question.
  I've searched the application and found nothing really useful. I do
  know that TG2 is based on Pylons so I guess it uses the Pylons way.

  Don't know if it helps but the same app is working with paster serve
  on the personal machine. To test it I'm usinghttp://localhost:8080.

  Sorry for my lack of knowledge but I'm fairly new to web development
  in Python.

 It isn't your fault. The problem is that 'paster serve' does
 additional setup of the process environment and application beyond
 what 'loadapp' by itself does. Given that recipes for using an
 alternate WSGI server often only talk about loadapp and not what else
 has to be done, you cant replicate the setup in the same way and this
 is why you get differences like you are encountering between paste
 server and other hosting methods. Same sort of problem occurs in other
 frameworks as well when trying to move from their builtin development
 servers to other hosting mechanism. It all really sucks and the base
 framework developers seem to not usually care much about making it
 easier by providing single object entry points that do everything that
 the internal web servers do.

 That said, TG setup instructions I have seen have been reasonably good
 at capturing these extra hidden steps. The question is why one of
 these steps they note, which is the app.get() isn't working.

 Can you perhaps try:

   app.get()

 and see if it makes a difference. It may be something to do with
 trailing slash where something is handling single slash differently.

 Graham

  If you have suggestion for debugging this issue I would be glad to try
  it.

  Regards,
   Vitor (noisebleed)

  On 21 Abr, 03:29, Graham Dumpleton graham.dumple...@gmail.com wrote:
  On 21 April 2010 00:42, noisebleed vitorbrandao...@gmail.com wrote:

   Hi all. First message sent to modwsgi mailing list.

   I've built a small web application with TurboGears2 and tested it
   inside a virtualenv (on my personal machine) with paster serve
   development.ini. Works just fine.

   Then I built an Egg and installed system-wide on my server. Defined a
   new Apache2 vhost and configured both Apache and the wsgi script
   created by modwsgideploy. After some adjustments I'm stuck with the
   message in the email subject. When visiting my URL Apache shows 500
   Internal Server Error.

   Here goes an excerpt from Apache error log:

   [info] Initial (No.1) HTTPS request received for child 1 (server
   gatekeeper.localhost:443)
   [info] mod_wsgi (pid=21618): Create interpreter 'gatekeeper.localhost:
   5|'.
   [info] [client 192.168.1.103] mod_wsgi (pid=21618,
   process='gatekeeper', application='gatekeeper.localhost:5|'):
   Loading WSGI script '/var/www/modwsgi/gatekeeper/
   gatekeeper.wsgi'.
   [error] 15:54:44,649 DEBUG [pylons.configuration] Initializing
   configuration, package:
   'gatekeeper'
   [error] 15:54:44,651 DEBUG [pylons.configuration] Pushing process
   configuration
   [error] 15:54:44,681 DEBUG [pylons.configuration] Adding mako engine
   with alias None and {'mako.directories': ['/usr/lib/python2.6/site-
   packages/GateKeeper-0.1dev-py2.6.egg/gatekeeper/templates'],
   'myghty.component_root': [{'templates': '/usr/lib/python2.6/site-
   packages/GateKeeper-0.1dev-py2.6.egg/gatekeeper/templates'}],
   'myghty.data_dir': '/var/www/modwsgi/gatekeeper/data/templates',
   'kid.encoding': 'utf-8', 'kid.assume_encoding': 'utf-8',
   'mako.module_directory': '/var/www/modwsgi/gatekeeper/data/templates',
   'myghty.allow_globals': ['c', 'config', 'g', 'h', 'render', 'request',
   'session', 'translator', 'ungettext', '_', 'N_'],
   'myghty.output_encoding': 'utf-8', 'myghty.raise_error': True,
   'mako.output_encoding': 'utf-8', 'mako.filesystem_checks': True}
   options
   [error] 15:54:44,682 DEBUG [pylons.configuration] Loaded mako template
   engine as the default template
   renderer
   [error] 15:54:44,931 DEBUG [pylons.templating] Initialized Buffet
   object
   [error] 15:54:44,933 DEBUG [pylons.templating] Adding mako template
   language for use with
   Buffet
   [error] 15:54:44,934 DEBUG [routes.middleware] Initialized with method
   overriding = True, and 

[modwsgi] Re: AppError: Bad response: 404 Not Found (not 200 OK or 3xx redirect for /)

2010-04-21 Thread noisebleed
I hope so ;)

Updated the vhost file according to your suggestions.

- DocumentRoot /opt/nexttoyou/www/modwsgi/gatekeeper

- WSGIDaemonProcess gatekeeper threads=10 processes=3
+ WSGIDaemonProcess gatekeeper user=apache group=apache processes=3
threads=10 maximum-requests=1000
WSGIProcessGroup gatekeeper


The docs are really good and I've checked FAQ and the configuration
docs but I'm still searching for that little magic trick that will put
this app flying...

Vitor (noisebleed)

In the meanwhile I've installed TG2 in the server (virtualenv), built
the quickstart project (named to GateKeeper/gatekeeper), changed
gatekeeper.wsgi to read from virtualenv but the results are the same.
Paster serve works here too...



On 21 Abr, 15:28, Carl Nobile carl.nob...@gmail.com wrote:
 Vitor,

 The first time through is always the roughest. You'll get it working
 and the next time you'll be the expert.

 I see no major issues, but there are a few thing that you could change.

 1st don't define DocumentRoot at all. You don't want people accessing
 your gatekeeper.wsgi hook file or anything else in there.
 2nd you should do something like this with the WSGIDaemonProcess

 WSGIDaemonProcess some process user=some user group=some group \
                                    processes=3 threads=10 
 maximum-requests=1000
 WSGIProcessGroup some process

 Adding a user and group makes it easy to see what is running in a ps
 -ef. Also you should always have a 'maximum-requests', this will limit
 the number of request any one thread will process thus avoiding memory
 leaks. All apps leak memory so don't assume your code won't I know for
 a fact that Python itself leaks memory.

 Maybe Graham will find something else. He's the author of mod_wsgi so
 he is the definitive source of info on it.

 Also you can check the docs for mod_wsgi, Graham is very thorough documenter.

 http://code.google.com/p/modwsgi/w/list

 ~Carl

 On Wed, Apr 21, 2010 at 10:08 AM, noisebleed vitorbrandao...@gmail.com 
 wrote:
  The file is a bit long (it's using SSL) but the WSGI section is right
  on top. I'm posting everything anyway.
  While testing I've used a Directory /var/www/modwsgi/gatekeeper/
  public/images directive and I was able to browse the images folder
  so I guess everything is fine here. Or isn't?..

  # - vhost begin -

  Listen 5

  IfDefine SSL
  IfModule mod_ssl.c
  ##
  ## SSL Virtual Host Context
  ##
  VirtualHost *:5

         #   General setup for the virtual host
         ServerName gatekeeper.localhost
         ServerAdmin ad...@localhost
         DocumentRoot /var/www/modwsgi/gatekeeper

         WSGIScriptAlias / /var/www/modwsgi/gatekeeper/gatekeeper.wsgi
         Alias /images /var/www/gatekeeper/public/images
         Alias /css /var/www/gatekeeper/public/css
         Alias /files /var/www/gatekeeper/public/files
         Alias /js /var/www/gatekeeper/public/js

         WSGIDaemonProcess gatekeeper threads=10 processes=3
         WSGIProcessGroup gatekeeper
         WSGIPassAuthorization On

         LogLevel debug

         ErrorLog /var/log/apache2/ssl_error_log
         IfModule mod_log_config.c
                 TransferLog /var/log/apache2/ssl_access_log
         /IfModule

         #   SSL Engine Switch:
         #   Enable/Disable SSL for this virtual host.
         SSLEngine on
         SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:
  +SSLv2:+EXP:+eNULL
         SSLCertificateFile /etc/ssl/apache2/gatekeeper/server.crt
         SSLCertificateKeyFile /etc/ssl/apache2/gatekeeper/server.pem
         SetEnvIf User-Agent .*MSIE.* nokeepalive ssl-unclean-
  shutdown

         Files ~ \.(cgi|shtml|phtml|php?)$
                 SSLOptions +StdEnvVars
         /Files

         IfModule mod_setenvif.c
                 SetEnvIf User-Agent .*MSIE.* nokeepalive ssl-unclean-
  shutdown \
                 downgrade-1.0 force-response-1.0
         /IfModule

         #   Per-Server Logging:
         #   The home of a custom SSL log file. Use this when you want
  a
         #   compact non-error SSL logfile on a virtual host basis.
         IfModule mod_log_config.c
                 CustomLog /var/log/apache2/ssl_request_log \
                 %t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \%r\ %b
         /IfModule

         IfModule mod_rewrite.c
                 RewriteEngine On
                 RewriteOptions inherit
         /IfModule

         Directory /var/www/gatekeeper
                 Order allow,deny
                 Allow from all
                 #Allow from 10.17.1.0/24
         /Directory

         Directory /var/www/modwsgi/gatekeeper
                 Order allow,deny
                 Allow from all
                 #Allow from 10.17.1.0/24
         /Directory

  /VirtualHost

  /IfModule
  /IfDefine

  # - vhost end -

  Thanks Carl and Graham for taking your time to look at this. I'm now
  spending more time trying to deploy the app than building it :/

  Vitor (noisebleed)

  

[modwsgi] Re: AppError: Bad response: 404 Not Found (not 200 OK or 3xx redirect for /)

2010-04-21 Thread noisebleed
I hope so ;)

Updated the vhost file according to your suggestions.

- DocumentRoot /var/www/modwsgi/gatekeeper

- WSGIDaemonProcess gatekeeper threads=10 processes=3
+ WSGIDaemonProcess gatekeeper user=apache group=apache processes=3
threads=10 maximum-requests=1000
WSGIProcessGroup gatekeeper

The docs are really good and I've checked FAQ and the configuration
docs but I'm still searching for that little magic trick that will put
this app flying...

Vitor (noisebleed)

In the meanwhile I've installed TG2 in the server (virtualenv), built
the quickstart project (named to GateKeeper/gatekeeper), changed
gatekeeper.wsgi to read from virtualenv but the results are the same.
Paster serve works here too...

On 21 Abr, 15:28, Carl Nobile carl.nob...@gmail.com wrote:
 Vitor,

 The first time through is always the roughest. You'll get it working
 and the next time you'll be the expert.

 I see no major issues, but there are a few thing that you could change.

 1st don't define DocumentRoot at all. You don't want people accessing
 your gatekeeper.wsgi hook file or anything else in there.
 2nd you should do something like this with the WSGIDaemonProcess

 WSGIDaemonProcess some process user=some user group=some group \
                                    processes=3 threads=10 
 maximum-requests=1000
 WSGIProcessGroup some process

 Adding a user and group makes it easy to see what is running in a ps
 -ef. Also you should always have a 'maximum-requests', this will limit
 the number of request any one thread will process thus avoiding memory
 leaks. All apps leak memory so don't assume your code won't I know for
 a fact that Python itself leaks memory.

 Maybe Graham will find something else. He's the author of mod_wsgi so
 he is the definitive source of info on it.

 Also you can check the docs for mod_wsgi, Graham is very thorough documenter.

 http://code.google.com/p/modwsgi/w/list

 ~Carl

 On Wed, Apr 21, 2010 at 10:08 AM, noisebleed vitorbrandao...@gmail.com 
 wrote:
  The file is a bit long (it's using SSL) but the WSGI section is right
  on top. I'm posting everything anyway.
  While testing I've used a Directory /var/www/modwsgi/gatekeeper/
  public/images directive and I was able to browse the images folder
  so I guess everything is fine here. Or isn't?..

  # - vhost begin -

  Listen 5

  IfDefine SSL
  IfModule mod_ssl.c
  ##
  ## SSL Virtual Host Context
  ##
  VirtualHost *:5

         #   General setup for the virtual host
         ServerName gatekeeper.localhost
         ServerAdmin ad...@localhost
         DocumentRoot /var/www/modwsgi/gatekeeper

         WSGIScriptAlias / /var/www/modwsgi/gatekeeper/gatekeeper.wsgi
         Alias /images /var/www/gatekeeper/public/images
         Alias /css /var/www/gatekeeper/public/css
         Alias /files /var/www/gatekeeper/public/files
         Alias /js /var/www/gatekeeper/public/js

         WSGIDaemonProcess gatekeeper threads=10 processes=3
         WSGIProcessGroup gatekeeper
         WSGIPassAuthorization On

         LogLevel debug

         ErrorLog /var/log/apache2/ssl_error_log
         IfModule mod_log_config.c
                 TransferLog /var/log/apache2/ssl_access_log
         /IfModule

         #   SSL Engine Switch:
         #   Enable/Disable SSL for this virtual host.
         SSLEngine on
         SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:
  +SSLv2:+EXP:+eNULL
         SSLCertificateFile /etc/ssl/apache2/gatekeeper/server.crt
         SSLCertificateKeyFile /etc/ssl/apache2/gatekeeper/server.pem
         SetEnvIf User-Agent .*MSIE.* nokeepalive ssl-unclean-
  shutdown

         Files ~ \.(cgi|shtml|phtml|php?)$
                 SSLOptions +StdEnvVars
         /Files

         IfModule mod_setenvif.c
                 SetEnvIf User-Agent .*MSIE.* nokeepalive ssl-unclean-
  shutdown \
                 downgrade-1.0 force-response-1.0
         /IfModule

         #   Per-Server Logging:
         #   The home of a custom SSL log file. Use this when you want
  a
         #   compact non-error SSL logfile on a virtual host basis.
         IfModule mod_log_config.c
                 CustomLog /var/log/apache2/ssl_request_log \
                 %t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \%r\ %b
         /IfModule

         IfModule mod_rewrite.c
                 RewriteEngine On
                 RewriteOptions inherit
         /IfModule

         Directory /var/www/gatekeeper
                 Order allow,deny
                 Allow from all
                 #Allow from 10.17.1.0/24
         /Directory

         Directory /var/www/modwsgi/gatekeeper
                 Order allow,deny
                 Allow from all
                 #Allow from 10.17.1.0/24
         /Directory

  /VirtualHost

  /IfModule
  /IfDefine

  # - vhost end -

  Thanks Carl and Graham for taking your time to look at this. I'm now
  spending more time trying to deploy the app than building it :/

  Vitor (noisebleed)

  On 21 Abr, 

Re: [modwsgi] Re: AppError: Bad response: 404 Not Found (not 200 OK or 3xx redirect for /)

2010-04-21 Thread Carl Nobile
You should use a user and group that are not apache. I usually put
each project in a different user and group so I know exactly which
processes and threads are running for a specific project.

Below is a link I found that may help.

http://getmediacore.com/blog/turbogears-2-tg2-with-mod_wsgi-and-virtual-environments/

~Carl

On Wed, Apr 21, 2010 at 11:12 AM, noisebleed vitorbrandao...@gmail.com wrote:
 I hope so ;)

 Updated the vhost file according to your suggestions.

 - DocumentRoot /var/www/modwsgi/gatekeeper

 - WSGIDaemonProcess gatekeeper threads=10 processes=3
 + WSGIDaemonProcess gatekeeper user=apache group=apache processes=3
 threads=10 maximum-requests=1000
 WSGIProcessGroup gatekeeper

 The docs are really good and I've checked FAQ and the configuration
 docs but I'm still searching for that little magic trick that will put
 this app flying...

 Vitor (noisebleed)

 In the meanwhile I've installed TG2 in the server (virtualenv), built
 the quickstart project (named to GateKeeper/gatekeeper), changed
 gatekeeper.wsgi to read from virtualenv but the results are the same.
 Paster serve works here too...

 On 21 Abr, 15:28, Carl Nobile carl.nob...@gmail.com wrote:
 Vitor,

 The first time through is always the roughest. You'll get it working
 and the next time you'll be the expert.

 I see no major issues, but there are a few thing that you could change.

 1st don't define DocumentRoot at all. You don't want people accessing
 your gatekeeper.wsgi hook file or anything else in there.
 2nd you should do something like this with the WSGIDaemonProcess

 WSGIDaemonProcess some process user=some user group=some group \
                                    processes=3 threads=10 
 maximum-requests=1000
 WSGIProcessGroup some process

 Adding a user and group makes it easy to see what is running in a ps
 -ef. Also you should always have a 'maximum-requests', this will limit
 the number of request any one thread will process thus avoiding memory
 leaks. All apps leak memory so don't assume your code won't I know for
 a fact that Python itself leaks memory.

 Maybe Graham will find something else. He's the author of mod_wsgi so
 he is the definitive source of info on it.

 Also you can check the docs for mod_wsgi, Graham is very thorough documenter.

 http://code.google.com/p/modwsgi/w/list

 ~Carl

 On Wed, Apr 21, 2010 at 10:08 AM, noisebleed vitorbrandao...@gmail.com 
 wrote:
  The file is a bit long (it's using SSL) but the WSGI section is right
  on top. I'm posting everything anyway.
  While testing I've used a Directory /var/www/modwsgi/gatekeeper/
  public/images directive and I was able to browse the images folder
  so I guess everything is fine here. Or isn't?..

  # - vhost begin -

  Listen 5

  IfDefine SSL
  IfModule mod_ssl.c
  ##
  ## SSL Virtual Host Context
  ##
  VirtualHost *:5

         #   General setup for the virtual host
         ServerName gatekeeper.localhost
         ServerAdmin ad...@localhost
         DocumentRoot /var/www/modwsgi/gatekeeper

         WSGIScriptAlias / /var/www/modwsgi/gatekeeper/gatekeeper.wsgi
         Alias /images /var/www/gatekeeper/public/images
         Alias /css /var/www/gatekeeper/public/css
         Alias /files /var/www/gatekeeper/public/files
         Alias /js /var/www/gatekeeper/public/js

         WSGIDaemonProcess gatekeeper threads=10 processes=3
         WSGIProcessGroup gatekeeper
         WSGIPassAuthorization On

         LogLevel debug

         ErrorLog /var/log/apache2/ssl_error_log
         IfModule mod_log_config.c
                 TransferLog /var/log/apache2/ssl_access_log
         /IfModule

         #   SSL Engine Switch:
         #   Enable/Disable SSL for this virtual host.
         SSLEngine on
         SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:
  +SSLv2:+EXP:+eNULL
         SSLCertificateFile /etc/ssl/apache2/gatekeeper/server.crt
         SSLCertificateKeyFile /etc/ssl/apache2/gatekeeper/server.pem
         SetEnvIf User-Agent .*MSIE.* nokeepalive ssl-unclean-
  shutdown

         Files ~ \.(cgi|shtml|phtml|php?)$
                 SSLOptions +StdEnvVars
         /Files

         IfModule mod_setenvif.c
                 SetEnvIf User-Agent .*MSIE.* nokeepalive ssl-unclean-
  shutdown \
                 downgrade-1.0 force-response-1.0
         /IfModule

         #   Per-Server Logging:
         #   The home of a custom SSL log file. Use this when you want
  a
         #   compact non-error SSL logfile on a virtual host basis.
         IfModule mod_log_config.c
                 CustomLog /var/log/apache2/ssl_request_log \
                 %t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \%r\ %b
         /IfModule

         IfModule mod_rewrite.c
                 RewriteEngine On
                 RewriteOptions inherit
         /IfModule

         Directory /var/www/gatekeeper
                 Order allow,deny
                 Allow from all
                 #Allow from 10.17.1.0/24
         /Directory


[modwsgi] Re: AppError: Bad response: 404 Not Found (not 200 OK or 3xx redirect for /)

2010-04-21 Thread noisebleed
Ok, made some more tests and:

1)  'paster serve development.ini' inside virtualenv (with source bin/
activate) works.
2)  'paster serve production.ini' run by root or apache and using
python packages in /usr/lib/pyton doesn't work.

It must be something not set in the global environment (outside
virtualenv) and/or TG2/Pylons configuration which is outside the scope
of mod_wsgi. Nevertheless can I still ask for support here about this
issue?

I've saved both logs and made a comparison. To this point they have
the same output:

# --- Begin paster-1/2.log ---

[routes.middleware] Matched
GET /
[routes.middleware] Route path: '*url', defaults: {'action':
u'routes_placeholder', 'controller':
u'root'}
[routes.middleware] Match dict: {'url': '', 'action':
u'routes_placeholder', 'controller':
u'root'}
[pylons.wsgiapp] Setting up Pylons stacked object
globals
[pylons.wsgiapp] Resolved URL to controller:
u'root'
[tw.core.resources] Registered static at /tw.forms/
static
[tw.core.resources] Registered static/calendar at /tw.forms/static/
calendar
[tg.wsgiapp] Found controller, module: 'gatekeeper.controllers.root',
class:
'RootController'
[pylons.wsgiapp] Controller appears to be a class,
instantiating
[pylons.wsgiapp] Calling controller class with WSGI interface
[pylons.controllers.core] Calling '__before__' method (...)

# --- End paster-1/2.log ---

After this call I can see different output.

Virtualenv works:
# --- Begin paster-1.log ---

[tg.i18n] Set request language to ['pt-pt', 'pt', 'en', 'en-
us']
[tg.i18n] Set request language for FormEncode to ['pt-pt', 'pt', 'en',
'en-
us']
[tg.controllers] No controller-wide authorization
at /
[tg.controllers] No controller-wide authorization
at /
[pylons.controllers.core] Looking for u'routes_placeholder' method to
handle the
request
[pylons.controllers.core] Calling 'routes_placeholder' method

# --- End paster-1.log ---

System-wide doesn't:
# --- Begin paster-2.log ---

[tg.i18n] Set request language to ['pt-pt', 'pt', 'en', 'en-us']
[tg.i18n] Set request language for FormEncode to ['pt-pt', 'pt', 'en',
'en-us']
[tg.controllers] No controller-wide authorization at /
[pylons.controllers.core] Merging pylons.response headers into
start_response call, status: 404 Not Found
[auth] no challenge required
[auth] -- repoze.who request ended (/) --
[txn.-1238922384] commit
[tg.configuration] Removing DBSession from current thread

# --- End paster-2.log ---


Carl, thanks for the link you sent. I already took some info from
there and tried the approach with virtualenv but that didn't work.

Vitor (noisebleed)

On 21 Abr, 16:49, Carl Nobile carl.nob...@gmail.com wrote:
 You should use a user and group that are not apache. I usually put
 each project in a different user and group so I know exactly which
 processes and threads are running for a specific project.

 Below is a link I found that may help.

 http://getmediacore.com/blog/turbogears-2-tg2-with-mod_wsgi-and-virtu...

 ~Carl

 On Wed, Apr 21, 2010 at 11:12 AM, noisebleed vitorbrandao...@gmail.com 
 wrote:
  I hope so ;)

  Updated the vhost file according to your suggestions.

  - DocumentRoot /var/www/modwsgi/gatekeeper

  - WSGIDaemonProcess gatekeeper threads=10 processes=3
  + WSGIDaemonProcess gatekeeper user=apache group=apache processes=3
  threads=10 maximum-requests=1000
  WSGIProcessGroup gatekeeper

  The docs are really good and I've checked FAQ and the configuration
  docs but I'm still searching for that little magic trick that will put
  this app flying...

  Vitor (noisebleed)

  In the meanwhile I've installed TG2 in the server (virtualenv), built
  the quickstart project (named to GateKeeper/gatekeeper), changed
  gatekeeper.wsgi to read from virtualenv but the results are the same.
  Paster serve works here too...

  On 21 Abr, 15:28, Carl Nobile carl.nob...@gmail.com wrote:
  Vitor,

  The first time through is always the roughest. You'll get it working
  and the next time you'll be the expert.

  I see no major issues, but there are a few thing that you could change.

  1st don't define DocumentRoot at all. You don't want people accessing
  your gatekeeper.wsgi hook file or anything else in there.
  2nd you should do something like this with the WSGIDaemonProcess

  WSGIDaemonProcess some process user=some user group=some group \
                                     processes=3 threads=10 
  maximum-requests=1000
  WSGIProcessGroup some process

  Adding a user and group makes it easy to see what is running in a ps
  -ef. Also you should always have a 'maximum-requests', this will limit
  the number of request any one thread will process thus avoiding memory
  leaks. All apps leak memory so don't assume your code won't I know for
  a fact that Python itself leaks memory.

  Maybe Graham will find something else. He's the author of mod_wsgi so
  he is the definitive source of info on it.

  Also you can check the docs for mod_wsgi, Graham is very thorough 
  documenter.

 

[modwsgi] Re: Problem with Python versions

2010-04-21 Thread Diego H.
This is all the capture.


mod_wsgi.c:4737: error: expected expression before ‘module’
mod_wsgi.c:4757: error: ‘path’ undeclared (first use in this function)
mod_wsgi.c:4759: error: expected identifier or ‘(’ before ‘=’ token
mod_wsgi.c:4762: error: expected expression before ‘module’
mod_wsgi.c:4765: error: ‘old’ undeclared (first use in this function)
mod_wsgi.c:4766: error: ‘new’ undeclared (first use in this function)
mod_wsgi.c:4767: error: ‘tmp’ undeclared (first use in this function)
mod_wsgi.c:4780: error: expected expression before ‘module’
mod_wsgi.c:4789: error: ‘args’ undeclared (first use in this function)
mod_wsgi.c:4791: error: ‘result’ undeclared (first use in this
function)
mod_wsgi.c:4796: error: ‘DELIM’ undeclared (first use in this
function)
mod_wsgi.c:4808: warning: assignment makes pointer from integer
without a cast
mod_wsgi.c:4811: error: expected ‘;’ before ‘ap_log_error’
mod_wsgi.c:4816: error: expected ‘;’ before ‘args’
mod_wsgi.c:4821: error: expected ‘;’ before ‘ap_log_error’
mod_wsgi.c:4826: error: expected ‘;’ before ‘}’ token
mod_wsgi.c:4844: warning: assignment makes pointer from integer
without a cast
mod_wsgi.c:4847: error: expected ‘;’ before ‘ap_log_error’
mod_wsgi.c:4852: error: expected ‘;’ before ‘args’
mod_wsgi.c:4857: error: expected ‘;’ before ‘ap_log_error’
mod_wsgi.c:4863: error: expected ‘;’ before ‘}’ token
mod_wsgi.c:4874: error: expected ‘;’ before ‘ap_log_error’
mod_wsgi.c:4879: error: expected ‘;’ before ‘args’
mod_wsgi.c:4884: error: expected ‘;’ before ‘ap_log_error’
mod_wsgi.c:4889: error: expected ‘;’ before ‘}’ token
mod_wsgi.c:4898: error: expected ‘;’ before ‘ap_log_error’
mod_wsgi.c:4902: error: expected ‘;’ before ‘}’ token
mod_wsgi.c:4924: error: expected expression before ‘module’
mod_wsgi.c:4926: error: expected ‘;’ before ‘ap_log_error’
mod_wsgi.c:4930: error: expected ‘;’ before ‘}’ token
mod_wsgi.c:4934: error: expected ‘;’ before ‘ap_log_error’
mod_wsgi.c:4938: error: expected ‘;’ before ‘}’ token
mod_wsgi.c:4941: error: expected expression before ‘module’
mod_wsgi.c:4956: error: expected identifier or ‘(’ before ‘=’ token
mod_wsgi.c:4958: error: expected expression before ‘module’
mod_wsgi.c:4959: error: ‘modules’ undeclared (first use in this
function)
mod_wsgi.c:4962: error: expected identifier or ‘(’ before ‘=’ token
mod_wsgi.c:4964: error: expected expression before ‘module’
mod_wsgi.c:4972: error: expected identifier or ‘(’ before ‘=’ token
mod_wsgi.c:4974: error: expected expression before ‘module’
mod_wsgi.c:4978: error: expected ‘;’ before ‘ap_log_error’
mod_wsgi.c:4982: error: expected ‘;’ before ‘}’ token
mod_wsgi.c:4989: error: expected expression before ‘module’
mod_wsgi.c:5005: error: expected expression before ‘module’
mod_wsgi.c:5007: error: expected expression before ‘module’
mod_wsgi.c:5011: error: expected expression before ‘module’
mod_wsgi.c:5024: error: expected identifier or ‘(’ before ‘=’ token
mod_wsgi.c:5027: error: expected identifier or ‘(’ before ‘=’ token
mod_wsgi.c:5029: error: expected expression before ‘module’
mod_wsgi.c:5033: error: expected identifier or ‘(’ before ‘=’ token
mod_wsgi.c:5035: error: expected expression before ‘module’
mod_wsgi.c:5037: error: expected ‘;’ before ‘ap_log_error’
mod_wsgi.c:5042: error: expected ‘;’ before ‘PyErr_Print’
mod_wsgi.c:5046: error: expected identifier or ‘(’ before ‘=’ token
mod_wsgi.c:5053: error: expected ‘;’ before ‘ap_log_error’
mod_wsgi.c:5057: error: expected ‘;’ before ‘}’ token
mod_wsgi.c:5060: error: expected expression before ‘module’
mod_wsgi.c:5061: error: expected identifier or ‘(’ before ‘=’ token
mod_wsgi.c:5063: error: expected expression before ‘module’
mod_wsgi.c:5071: error: expected expression before ‘module’
mod_wsgi.c:5075: error: expected expression before ‘module’
mod_wsgi.c:5093: error: ‘InterpreterObject’ has no member named
‘owner’
mod_wsgi.c:5098: error: ‘InterpreterObject’ has no member named
‘tstate_table’
mod_wsgi.c:5116: error: ‘InterpreterObject’ has no member named ‘name’
mod_wsgi.c:5119: error: ‘InterpreterObject’ has no member named
‘tstate_table’
mod_wsgi.c: In function ‘Interpreter_dealloc’:
mod_wsgi.c:5134: error: ‘PyThreadState’ undeclared (first use in this
function)
mod_wsgi.c:5134: error: ‘tstate’ undeclared (first use in this
function)
mod_wsgi.c:5135: error: ‘PyObject’ undeclared (first use in this
function)
mod_wsgi.c:5135: error: ‘exitfunc’ undeclared (first use in this
function)
mod_wsgi.c:5136: error: expected expression before ‘module’
mod_wsgi.c:5148: error: ‘InterpreterObject’ has no member named ‘name’
mod_wsgi.c:5165: error: ‘InterpreterObject’ has no member named
‘tstate_table’
mod_wsgi.c:5169: error: ‘InterpreterObject’ has no member named
‘interp’
mod_wsgi.c:5175: error: ‘InterpreterObject’ has no member named ‘name’
mod_wsgi.c:5178: error: ‘InterpreterObject’ has no member named
‘tstate_table’
mod_wsgi.c:5190: error: ‘InterpreterObject’ has no member named
‘owner’
mod_wsgi.c:5191: error: 

Re: [modwsgi] Re: AppError: Bad response: 404 Not Found (not 200 OK or 3xx redirect for /)

2010-04-21 Thread Carl Nobile
If there is somebody on the list that knows TG2 then you're in luck,
but I wouldn't run away yet, wait for Graham to be back online he may
be able to point you in the right direction.

BTW You sometime send two exact same posts.

Ciao O senhor, minha portugues e minto mal.

~Carl

On Wed, Apr 21, 2010 at 1:32 PM, noisebleed vitorbrandao...@gmail.com wrote:
 Ok, made some more tests and:

 1)  'paster serve development.ini' inside virtualenv (with source bin/
 activate) works.
 2)  'paster serve production.ini' run by root or apache and using
 python packages in /usr/lib/pyton doesn't work.

 It must be something not set in the global environment (outside
 virtualenv) and/or TG2/Pylons configuration which is outside the scope
 of mod_wsgi. Nevertheless can I still ask for support here about this
 issue?

 I've saved both logs and made a comparison. To this point they have
 the same output:

 # --- Begin paster-1/2.log ---

 [routes.middleware] Matched
 GET /
 [routes.middleware] Route path: '*url', defaults: {'action':
 u'routes_placeholder', 'controller':
 u'root'}
 [routes.middleware] Match dict: {'url': '', 'action':
 u'routes_placeholder', 'controller':
 u'root'}
 [pylons.wsgiapp] Setting up Pylons stacked object
 globals
 [pylons.wsgiapp] Resolved URL to controller:
 u'root'
 [tw.core.resources] Registered static at /tw.forms/
 static
 [tw.core.resources] Registered static/calendar at /tw.forms/static/
 calendar
 [tg.wsgiapp] Found controller, module: 'gatekeeper.controllers.root',
 class:
 'RootController'
 [pylons.wsgiapp] Controller appears to be a class,
 instantiating
 [pylons.wsgiapp] Calling controller class with WSGI interface
 [pylons.controllers.core] Calling '__before__' method (...)

 # --- End paster-1/2.log ---

 After this call I can see different output.

 Virtualenv works:
 # --- Begin paster-1.log ---

 [tg.i18n] Set request language to ['pt-pt', 'pt', 'en', 'en-
 us']
 [tg.i18n] Set request language for FormEncode to ['pt-pt', 'pt', 'en',
 'en-
 us']
 [tg.controllers] No controller-wide authorization
 at /
 [tg.controllers] No controller-wide authorization
 at /
 [pylons.controllers.core] Looking for u'routes_placeholder' method to
 handle the
 request
 [pylons.controllers.core] Calling 'routes_placeholder' method

 # --- End paster-1.log ---

 System-wide doesn't:
 # --- Begin paster-2.log ---

 [tg.i18n] Set request language to ['pt-pt', 'pt', 'en', 'en-us']
 [tg.i18n] Set request language for FormEncode to ['pt-pt', 'pt', 'en',
 'en-us']
 [tg.controllers] No controller-wide authorization at /
 [pylons.controllers.core] Merging pylons.response headers into
 start_response call, status: 404 Not Found
 [auth] no challenge required
 [auth] -- repoze.who request ended (/) --
 [txn.-1238922384] commit
 [tg.configuration] Removing DBSession from current thread

 # --- End paster-2.log ---


 Carl, thanks for the link you sent. I already took some info from
 there and tried the approach with virtualenv but that didn't work.

 Vitor (noisebleed)

 On 21 Abr, 16:49, Carl Nobile carl.nob...@gmail.com wrote:
 You should use a user and group that are not apache. I usually put
 each project in a different user and group so I know exactly which
 processes and threads are running for a specific project.

 Below is a link I found that may help.

 http://getmediacore.com/blog/turbogears-2-tg2-with-mod_wsgi-and-virtu...

 ~Carl

 On Wed, Apr 21, 2010 at 11:12 AM, noisebleed vitorbrandao...@gmail.com 
 wrote:
  I hope so ;)

  Updated the vhost file according to your suggestions.

  - DocumentRoot /var/www/modwsgi/gatekeeper

  - WSGIDaemonProcess gatekeeper threads=10 processes=3
  + WSGIDaemonProcess gatekeeper user=apache group=apache processes=3
  threads=10 maximum-requests=1000
  WSGIProcessGroup gatekeeper

  The docs are really good and I've checked FAQ and the configuration
  docs but I'm still searching for that little magic trick that will put
  this app flying...

  Vitor (noisebleed)

  In the meanwhile I've installed TG2 in the server (virtualenv), built
  the quickstart project (named to GateKeeper/gatekeeper), changed
  gatekeeper.wsgi to read from virtualenv but the results are the same.
  Paster serve works here too...

  On 21 Abr, 15:28, Carl Nobile carl.nob...@gmail.com wrote:
  Vitor,

  The first time through is always the roughest. You'll get it working
  and the next time you'll be the expert.

  I see no major issues, but there are a few thing that you could change.

  1st don't define DocumentRoot at all. You don't want people accessing
  your gatekeeper.wsgi hook file or anything else in there.
  2nd you should do something like this with the WSGIDaemonProcess

  WSGIDaemonProcess some process user=some user group=some group \
                                     processes=3 threads=10 
  maximum-requests=1000
  WSGIProcessGroup some process

  Adding a user and group makes it easy to see what is running in a ps
  -ef. Also you should always have a 'maximum-requests', 

[modwsgi] Re: Error uploading files: IOError: request data read error

2010-04-21 Thread Jake
It turns out that for some reason for Red Hat Enterprise-based OS's,
version numbers often stay the same, only adding an additional version
number to it, for security updates.  For example, the most recent
version of httpd (Apache) for CentOS 5.4 is 2.2.3-31.  That -31 is the
updated version.
I'm really not sure if this affects the issue I'm having.

On Apr 21, 9:55 pm, Jake jakecro...@gmail.com wrote:
 I've found out I can update apache and stay on the media temple UOP,
 so I'll do that shortly and test again.
 Thanks

 On Apr 21, 3:19 pm, Jake jakecro...@gmail.com wrote:





  I've setup the WSGI debugging app, and when I try to get a page it
  shows me the headers. However when I submit the upload form I get
  firefox saying The connection to the server was reset while the page
  was loading. The same as I usually get, but Django usually emails me
  an exception and traceback.

  In firebug (without the WSGI debugging app in place) When I copy
  response or request headers, I get nothing.

  I hope that is useful information. I'm at a loss to explain it.

  As for apache, I'm reluctant to upgrade because of the Media Temple
  Update Option Program*. However I'll look into it now, if my apache is
  that old, then perhaps the UOP is not that useful.

  *http://kb.mediatemple.net/questions/97/FAQ:+Update+Option+Program+
  (UOP)

  On Apr 21, 10:58 am, Graham Dumpleton graham.dumple...@gmail.com
  wrote:

   On 21 April 2010 08:51, Jake jakecro...@gmail.com wrote:

I'm getting a request data read error when trying to upload files to
the Django admin interface.

Files under about 150k work, but bigger files always fail and almost
always at around 200k. The Exception I get is below.

File /usr/lib/python2.4/site-packages/django/http/
multipartparser.py, line 405, in read
  return self._file.read(num_bytes)
IOError: request data read error

I'm running python 2.4, django 1.1, apache 2.2.3, mod_wsgi 2.8, on
CentOS (a media temple DV server)
I've tried Chrome and Firefox on Windows and Firefox on Mac - Same
results.
I've tried wsgi daemon mode and embedded
I can upload to other sites so I don't think it's my connection.
Locally it's fine (Django development server)

Everything I've found on this error says it's a mod_python issue and
that changing to mod_wsgi will fix it, but I am running mod_wsgi.
Can anyone help?

   Use recipe in:

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

   to capture the WSGI environment as passed to the WSGI application and
   post it for analysis.

   Use FireBug in Firefox to capture the headers sent by the browser for
   the upload and post it for analysis.

   Try installing most recent Apache 2.2.X instead of the old version you
   are using in case it is all because of using old Apache. Especially do
   this as mostly pointless exercise debugging it if not using most up to
   date Apache.

   Graham

   --
   You received this message because you are subscribed to the Google Groups 
   modwsgi group.
   To post to this group, send email to modw...@googlegroups.com.
   To unsubscribe from this group, send email to 
   modwsgi+unsubscr...@googlegroups.com.
   For more options, visit this group 
   athttp://groups.google.com/group/modwsgi?hl=en.

  --
  You received this message because you are subscribed to the Google Groups 
  modwsgi group.
  To post to this group, send email to modw...@googlegroups.com.
  To unsubscribe from this group, send email to 
  modwsgi+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/modwsgi?hl=en.

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@googlegroups.com.
 To unsubscribe from this group, send email to 
 modwsgi+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/modwsgi?hl=en.

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



Re: [modwsgi] Re: Error uploading files: IOError: request data read error

2010-04-21 Thread Graham Dumpleton
On 22 April 2010 09:10, Jake jakecro...@gmail.com wrote:
 It turns out that for some reason for Red Hat Enterprise-based OS's,
 version numbers often stay the same, only adding an additional version
 number to it, for security updates.  For example, the most recent
 version of httpd (Apache) for CentOS 5.4 is 2.2.3-31.  That -31 is the
 updated version.
 I'm really not sure if this affects the issue I'm having.

The problem is that I believe they only patch security issues and not
actual bugs. So, if there is a bug fix in later versions of Apache
which is relevant to your problem, it isn't necessarily going to have
it.

Graham

 On Apr 21, 9:55 pm, Jake jakecro...@gmail.com wrote:
 I've found out I can update apache and stay on the media temple UOP,
 so I'll do that shortly and test again.
 Thanks

 On Apr 21, 3:19 pm, Jake jakecro...@gmail.com wrote:





  I've setup the WSGI debugging app, and when I try to get a page it
  shows me the headers. However when I submit the upload form I get
  firefox saying The connection to the server was reset while the page
  was loading. The same as I usually get, but Django usually emails me
  an exception and traceback.

  In firebug (without the WSGI debugging app in place) When I copy
  response or request headers, I get nothing.

  I hope that is useful information. I'm at a loss to explain it.

  As for apache, I'm reluctant to upgrade because of the Media Temple
  Update Option Program*. However I'll look into it now, if my apache is
  that old, then perhaps the UOP is not that useful.

  *http://kb.mediatemple.net/questions/97/FAQ:+Update+Option+Program+
  (UOP)

  On Apr 21, 10:58 am, Graham Dumpleton graham.dumple...@gmail.com
  wrote:

   On 21 April 2010 08:51, Jake jakecro...@gmail.com wrote:

I'm getting a request data read error when trying to upload files to
the Django admin interface.

Files under about 150k work, but bigger files always fail and almost
always at around 200k. The Exception I get is below.

File /usr/lib/python2.4/site-packages/django/http/
multipartparser.py, line 405, in read
  return self._file.read(num_bytes)
IOError: request data read error

I'm running python 2.4, django 1.1, apache 2.2.3, mod_wsgi 2.8, on
CentOS (a media temple DV server)
I've tried Chrome and Firefox on Windows and Firefox on Mac - Same
results.
I've tried wsgi daemon mode and embedded
I can upload to other sites so I don't think it's my connection.
Locally it's fine (Django development server)

Everything I've found on this error says it's a mod_python issue and
that changing to mod_wsgi will fix it, but I am running mod_wsgi.
Can anyone help?

   Use recipe in:

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

   to capture the WSGI environment as passed to the WSGI application and
   post it for analysis.

   Use FireBug in Firefox to capture the headers sent by the browser for
   the upload and post it for analysis.

   Try installing most recent Apache 2.2.X instead of the old version you
   are using in case it is all because of using old Apache. Especially do
   this as mostly pointless exercise debugging it if not using most up to
   date Apache.

   Graham

   --
   You received this message because you are subscribed to the Google 
   Groups modwsgi group.
   To post to this group, send email to modw...@googlegroups.com.
   To unsubscribe from this group, send email to 
   modwsgi+unsubscr...@googlegroups.com.
   For more options, visit this group 
   athttp://groups.google.com/group/modwsgi?hl=en.

  --
  You received this message because you are subscribed to the Google Groups 
  modwsgi group.
  To post to this group, send email to modw...@googlegroups.com.
  To unsubscribe from this group, send email to 
  modwsgi+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/modwsgi?hl=en.

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@googlegroups.com.
 To unsubscribe from this group, send email to 
 modwsgi+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/modwsgi?hl=en.

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



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