web.wsgi.runwsgi = lambda func, addr=None: web.wsgi.runfcgi(func,
addr) - this force script to start in fastcgi mode, You can remove it,
it will start in fastcgi when invoked by proper deamon.

On 17 Cze, 17:33, 大郎 <[email protected]> wrote:
> visit this url, I got 404:
> File does not exist: /home/68886/domains/autopart.hi0791.com/html/test.py/
>
> $ python test.py
>
> WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
> WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
> WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
> WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!
> Status: 404 Not Found
> Content-Type: text/html
> Content-Length: 9
>
> how can I fix this problem? thanks.
>
> # test.py
> #!/usr/bin/env python
> # coding: utf-8
>
> import web
>
> web.config.debug = True
> urls = ('/', 'Index')
>
> class Index:
>
>     def GET(self):
>         return 'this is a test web, bulid with webpy(webpy.org), version ' +
> web.__version__ + "OK"
>
> if __name__ == "__main__":
>     web.wsgi.runwsgi = lambda func, addr=None: web.wsgi.runfcgi(func, addr)
>     app = web.application(urls, globals())
>     app.run()
>
> # .htaccess
> <Files test.py>
>     SetHandler fastcgi-script
> </Files>
>
> <IfModule mod_rewrite.c>
>     RewriteEngine on
>     RewriteCond %{REQUEST_URI} !^/static
>     RewriteCond %{REQUEST_URI} !^(/.*)+test.py/
>     RewriteRule ^(.*)$ test.py/$1 [PT]
> </IfModule>
>
> --
> 百才招聘(baicai.com).产品部
> Email: [email protected]
> Gtalk: [email protected]
> twitter.com/qichangxing
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to