how robust is (CGIHTTPServer )

Discussion in 'Python' started by pxlpluker, May 9, 2004.

  1. pxlpluker

    pxlpluker Guest

    i was looking at twisted but it appears to be WAY beyond my megar
    skills at this point.
    so i think CGIHTTPServer will fit my needs if it is pretty stable.
    I have a small python cgi that i was building and i had this great idea
    of having the cgi server kinda rolled into it for various portability
    reasons and maybe some future features that would not have apache to
    realy on.

    Fred
     
    pxlpluker, May 9, 2004
    #1
    1. Advertising

  2. pxlpluker

    Ryan Paul Guest

    On Sat, 08 May 2004 21:02:29 -0400, pxlpluker wrote:

    > i was looking at twisted but it appears to be WAY beyond my megar
    > skills at this point.
    > so i think CGIHTTPServer will fit my needs if it is pretty stable.
    > I have a small python cgi that i was building and i had this great idea
    > of having the cgi server kinda rolled into it for various portability
    > reasons and maybe some future features that would not have apache to
    > realy on.
    >
    > Fred


    When faced with a frustrating deployment scenario, I too considered this
    possibility. The standard CGIHTTPServer is really more of a
    testing/debugging mechanism. I found that the 'Twistd' python network app
    framework met my needs better than the CGIHTTPServer module. It really
    depends on how much traffic you plan on dealing with.
     
    Ryan Paul, May 9, 2004
    #2
    1. Advertising

  3. pxlpluker

    pxlpluker Guest

    can anyone point out a good example of setting up a cgi capable twisted web?

    Ryan Paul wrote:

    >On Sat, 08 May 2004 21:02:29 -0400, pxlpluker wrote:
    >
    >
    >
    >> i was looking at twisted but it appears to be WAY beyond my megar
    >>skills at this point.
    >>so i think CGIHTTPServer will fit my needs if it is pretty stable.
    >>I have a small python cgi that i was building and i had this great idea
    >>of having the cgi server kinda rolled into it for various portability
    >>reasons and maybe some future features that would not have apache to
    >>realy on.
    >>
    >>Fred
    >>
    >>

    >
    >When faced with a frustrating deployment scenario, I too considered this
    >possibility. The standard CGIHTTPServer is really more of a
    >testing/debugging mechanism. I found that the 'Twistd' python network app
    >framework met my needs better than the CGIHTTPServer module. It really
    >depends on how much traffic you plan on dealing with.
    >
    >
     
    pxlpluker, May 9, 2004
    #3
  4. On Sun, May 09, 2004 at 08:08:43AM -0400, pxlpluker wrote:
    > can anyone point out a good example of setting up a cgi capable twisted
    > web?


    from twisted.web import twcgi, server
    from twisted.application import internet, service

    cgidir = twcgi.CGIDirectory('/var/www/cgi-bin') # Or wherever
    site = server.Site(cgidir)

    application = service.Application('cgi-demo')
    sc = service.IServiceCollection(application)
    i = internet.TCPServer(8080, site)
    i.setServiceParent(sc)

    if __name__ == '__main__':
    from twisted.internet import reactor
    sc.startService()
    reactor.run()
    sc.stopService()


    This script can be run directly, or you can use Twisted's "twistd" utility
    on it, which provides logging and daemonisation for you. (And if you use
    twistd you don't need the if __name__ == '__main__' part.)

    So, save this script as cgidemo.py and do:

    python cgidemo.py

    or:

    twistd -noy cgidemo.py # See twistd docs for meanings of -n, -o and -y.

    See http://twistedmatrix.com/documents/current/howto/using-twistedweb for
    more details, or ask on the twisted-web mailing list
    (http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web).

    -Andrew.
     
    Andrew Bennetts, May 9, 2004
    #4
  5. pxlpluker

    Wilk Guest

    pxlpluker <> writes:

    > i was looking at twisted but it appears to be WAY beyond my megar
    > skills at this point.
    > so i think CGIHTTPServer will fit my needs if it is pretty stable.
    > I have a small python cgi that i was building and i had this great
    > idea of having the cgi server kinda rolled into it for various
    > portability reasons and maybe some future features that would not have
    > apache to realy on.


    If you want to have your own server, you don't need CGI, you can start
    from BaseHTTPServer, it's very robust. I use it in production.
    CGIHTTPServer and SimpleHTTPServer are good examples to show how to
    expand BaseHTTPServer.

    --
    Wilk - http://flibuste.net
     
    Wilk, May 9, 2004
    #5
  6. pxlpluker

    pxlpluker Guest

    Wilk wrote:

    >pxlpluker <> writes:
    >
    >
    >
    >> i was looking at twisted but it appears to be WAY beyond my megar
    >>skills at this point.
    >>so i think CGIHTTPServer will fit my needs if it is pretty stable.
    >>I have a small python cgi that i was building and i had this great
    >>idea of having the cgi server kinda rolled into it for various
    >>portability reasons and maybe some future features that would not have
    >>apache to realy on.
    >>
    >>

    >
    >If you want to have your own server, you don't need CGI, you can start
    >from BaseHTTPServer, it's very robust. I use it in production.
    >CGIHTTPServer and SimpleHTTPServer are good examples to show how to
    >expand BaseHTTPServer.
    >
    >

    I think i need cgi to run python scripts though. I am allowing file
    upload with some user management/accounts.
    What kind of traffic does your site get?
     
    pxlpluker, May 9, 2004
    #6
  7. pxlpluker

    Wilk Guest

    pxlpluker <> writes:

    > Wilk wrote:
    >
    >>pxlpluker <> writes:
    >>
    >>
    >>
    >>> i was looking at twisted but it appears to be WAY beyond my megar
    >>>skills at this point.
    >>>so i think CGIHTTPServer will fit my needs if it is pretty stable.
    >>>I have a small python cgi that i was building and i had this great
    >>>idea of having the cgi server kinda rolled into it for various
    >>>portability reasons and maybe some future features that would not have
    >>>apache to realy on.
    >>>
    >>>

    >>
    >>If you want to have your own server, you don't need CGI, you can start
    >>from BaseHTTPServer, it's very robust. I use it in production.
    >>CGIHTTPServer and SimpleHTTPServer are good examples to show how to
    >>expand BaseHTTPServer.
    >>
    >>

    > I think i need cgi to run python scripts though. I am allowing file
    > upload with some user management/accounts.


    Everything you can do with cgi can be done without...

    > What kind of traffic does your site get?


    It's web-applications in intranet with database. There is one, for
    example, used in a factory, 24h/24 since two years.

    --
    Wilk - http://flibuste.net
     
    Wilk, May 11, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Hansen

    Re: Securing PyDoc and CGIHTTPserver

    Peter Hansen, Jul 10, 2003, in forum: Python
    Replies:
    7
    Views:
    436
    Peter Hansen
    Jul 15, 2003
  2. Shane Hathaway

    Re: Securing PyDoc and CGIHTTPserver

    Shane Hathaway, Jul 10, 2003, in forum: Python
    Replies:
    1
    Views:
    378
    Shane Hathaway
    Jul 11, 2003
  3. vincent delft

    CGIHTTPserver looze PYTHONPATH

    vincent delft, Jul 13, 2003, in forum: Python
    Replies:
    1
    Views:
    458
    vincent_delft
    Jul 13, 2003
  4. Andy Worms

    CGIHTTPServer security Breach

    Andy Worms, Jul 22, 2003, in forum: Python
    Replies:
    0
    Views:
    375
    Andy Worms
    Jul 22, 2003
  5. vincent wehren
    Replies:
    3
    Views:
    412
    vincent wehren
    Nov 27, 2003
Loading...

Share This Page