A few points to note.
Apache processes run as a special user and may not have ability to
read/write to the required directory.
The current working directory of an Apache process is NOT the
directory of the script file and you therefore cannot use relative
paths but must use absolute paths.
Apache/mod_wsgi can run in a multi process and/or multi thread
configuration and distinct processes/threads may be interfering with
each other.
Have a read of:
http://code.google.com/p/modwsgi/wiki/ApplicationIssues
for more detail on these sorts of issues.
Graham
Since web.py is somewhat dated, you may be better off using a more
modern framework such as Flask. For Flask there is available
Flask-OpenID. See:
http://packages.python.org/Flask-OpenID/
Otherwise you should hassle web.py maintainers.
Graham
> --
> You received this message because you are subscribed to the Google Groups "modwsgi" group.
> To post to this group, send email to mod...@googlegroups.com.
> To unsubscribe from this group, send email to modwsgi+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
>
>
in my site-enabled file...
WSGIDaemonProcess app processes=2 maximum-requests=500 threads=1
WSGIProcessGroup app
WSGIScriptAlias /myapp /var/www/cgi-bin/test.py
I believe the reason that the original web.py openid lib is failing is
it's restarting every time. Even if mod_wsgi is working correctly,
will using the library fail if it's running on multiple processes
since user requests might not hit the same instance consecutively? I
see there are apache processes being created as I increase the proces
to the daemon process, but should that still cause my test.py app to
start every frame?
Here's the end of web.py app.
app = web.application(urls, globals(), autoreload=False)
application = app.wsgifunc()
if __name__ == "__main__":
error("starting main")
app.run()
That could only be if process is crashing. Look in main Apache error
log for 'Segmentation fault' messages.
Also modify LogLevel directive in Apache and set it to:
LogLevel info
This will cause mod_wsgi to output messages about daemon process
start/stop and WSGI script loading so you can see more about when
stuff happening.
> in my site-enabled file...
>
> WSGIDaemonProcess app processes=2 maximum-requests=500 threads=1
Don't use 'maximum-requests' unless you have a good reason to. Should
never be used in a production site if you can avoid it.
Also initially suggest you use:
WSGIDaemonProcess app threads=1
Ie., a single process with a single thread. This will ensure requests
go back to same process and that it isn't due to multiprocess nature
of the configuration.
> WSGIProcessGroup app
> WSGIScriptAlias /myapp /var/www/cgi-bin/test.py
>
> I believe the reason that the original web.py openid lib is failing is
> it's restarting every time. Even if mod_wsgi is working correctly,
> will using the library fail if it's running on multiple processes
> since user requests might not hit the same instance consecutively? I
> see there are apache processes being created as I increase the proces
> to the daemon process, but should that still cause my test.py app to
> start every frame?
>
> Here's the end of web.py app.
>
> app = web.application(urls, globals(), autoreload=False)
> application = app.wsgifunc()
>
> if __name__ == "__main__":
> error("starting main")
> app.run()
The 'if' is redundant as only applies to when script run on command
line. Comment it out and see if script still works. If it doesn't then
you may actually be running your script as CGI through missing
configuration, although that would be dependent on app.run() running
it as a CGI script as opposed to a standalone server.
Graham