But...

Wait...

I'm not sure if web.py is suitable to CGI usage because it tends to execute
the dev web-server when executed and output the requests made to stdout that
would be where it should output the html it self to be delivered to the
Apache CGI handler.


CGI is not the same as Fast-CGI nor WSGI.

If you really want to work using CGI, for what you need a FrameWork?

You could build your app in pure python outputting the html code directly as
a simple print.


As usual, I can be wrong (If this is the case, please some one correct me).


Cheers

--
Leon Waldman
SysAdmin Linux - Arquiteto de Infra-Estrutura & TI.


On Thu, Nov 12, 2009 at 3:18 PM, Nakedsteve <[email protected]> wrote:

>
> That script works fine, the content shows without any errors...
>
> On Nov 10, 7:26 pm, Graham Dumpleton <[email protected]>
> wrote:
> > If you are intending it to be run as CGI, why is it then that FASTCGI
> > is being attempted by flup?
> >
> > I would suggest you put a hello world CGI script in their instead of
> > web.py code and see if that alone works. Use:
> >
> > #!/usr/bin/python
> > print "Content-type: text/html"
> > print
> > print "<title>CGI 101</title>"
> > print "<h1>A First CGI Example</h1>"
> > print "<P>Hello, CGI World!</p>"
> >
> > Graham
> >
> > On Nov 11, 7:26 am, Nakedsteve <[email protected]> wrote:
> >
> >
> >
> > > Yep, the script has #!/usr/bin/python at the first line but the error
> > > is still there.
> >
> > > On 10 Nov, 03:48, Leon Waldman <[email protected]> wrote:
> >
> > > > Hi,
> >
> > > > I can be wrong, but, as a cgi it should have the
> #!/path/to/python/binary on
> > > > the beginning of the script no?
> >
> > > > to find the path type on the terminal:
> > > > whereis python
> >
> > > > Test it, and let us know if this was the problem...
> >
> > > > Cheer
> >
> > > > --
> > > > Leon Waldman
> > > > SysAdmin Linux - Arquiteto de Infra-Estrutura & TI.
> >
> > > > On Tue, Nov 10, 2009 at 3:42 AM, Nakedsteve <[email protected]>
> wrote:
> >
> > > > > Hello everyone,
> >
> > > > > I've recently been trying to get webpy to work on my apache server
> > > > > using the cgi method (see:http://webpy.org/cookbook/cgi-apache),
> but
> > > > > unfortunately I've run into a problem. For some reason, every time
> I
> > > > > try to go to my script url, I see this error in apache2's
> error.log:
> >
> > > > > [Tue Nov 10 01:36:52 2009] [error] [client xx.xx.xxx.xx] attempt to
> > > > > invoke directory as script: /var/www/webpy/testapp/
> > > > > [Tue Nov 10 01:36:56 2009] [error] [client xx.xx.xxx.xx] Traceback
> > > > > (most recent call last):
> > > > > [Tue Nov 10 01:36:56 2009] [error] [client xx.xx.xxx.xx]   File
> "/var/
> > > > > www/webpy/testapp/main.py", line 12, in <module>
> > > > > [Tue Nov 10 01:36:56 2009] [error] [client xx.xx.xxx.xx]
> app.run()
> > > > > [Tue Nov 10 01:36:56 2009] [error] [client xx.xx.xxx.xx]   File
> "/usr/
> > > > > local/lib/python2.6/dist-packages/web.py-0.33-py2.6.egg/web/
> > > > > application.py", line 313, in run
> > > > > [Tue Nov 10 01:36:56 2009] [error] [client xx.xx.xxx.xx]     return
> > > > > wsgi.runwsgi(self.wsgifunc(*middleware))
> > > > > [Tue Nov 10 01:36:56 2009] [error] [client xx.xx.xxx.xx]   File
> "/usr/
> > > > >
> local/lib/python2.6/dist-packages/web.py-0.33-py2.6.egg/web/wsgi.py",
> > > > > line 35, in runwsgi
> > > > > [Tue Nov 10 01:36:56 2009] [error] [client xx.xx.xxx.xx]     return
> > > > > runfcgi(func, None)
> > > > > [Tue Nov 10 01:36:56 2009] [error] [client xx.xx.xxx.xx]   File
> "/usr/
> > > > >
> local/lib/python2.6/dist-packages/web.py-0.33-py2.6.egg/web/wsgi.py",
> > > > > line 17, in runfcgi
> > > > > [Tue Nov 10 01:36:56 2009] [error] [client xx.xx.xxx.xx]     return
> > > > > flups.WSGIServer(func, multiplexed=True, bindAddress=addr).run()
> > > > > [Tue Nov 10 01:36:56 2009] [error] [client xx.xx.xxx.xx]   File
> "/usr/
> > > > >
> local/lib/python2.6/dist-packages/flup-1.0.3.dev_20091027-py2.6.egg/
> > > > > flup/server/fcgi.py", line 112, in run
> > > > > [Tue Nov 10 01:36:56 2009] [error] [client xx.xx.xxx.xx]   File
> "/usr/
> > > > >
> local/lib/python2.6/dist-packages/flup-1.0.3.dev_20091027-py2.6.egg/
> > > > > flup/server/fcgi_base.py", line 1020, in _setupSocket
> > > > > [Tue Nov 10 01:36:56 2009] [error] [client xx.xx.xxx.xx]   File
> "/usr/
> > > > >
> local/lib/python2.6/dist-packages/flup-1.0.3.dev_20091027-py2.6.egg/
> > > > > flup/server/fcgi_base.py", line 569, in run
> > > > > [Tue Nov 10 01:36:56 2009] [error] [client xx.xx.xxx.xx]
> > > > > AttributeError: 'CGIRequest' object has no attribute '_timeout'
> > > > > [Tue Nov 10 01:36:56 2009] [error] [client xx.xx.xxx.xx] Premature
> end
> > > > > of script headers: main.py
> >
> > > > > I've searched around for a solution with no luck, so I'm hoping
> > > > > somebody here will be able to help. For reference, here is my site
> > > > > config file:
> >
> > > > > <VirtualHost *:80>
> > > > >        ...
> > > > >        ...
> > > > >        # Trying to get webpy to work
> > > > >        ScriptAlias /test "/var/www/webpy/testapp/"
> > > > >        <Directory "/var/www/webpy/testapp">
> > > > >                Options +ExecCGI +FollowSymLinks
> > > > >                Order allow,deny
> > > > >                Allow from all
> > > > >        </Directory>
> > > > > </VirtualHost>
> >
> > > > > Thanks in advance!
> >
>

--~--~---------~--~----~------------~-------~--~----~
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