how robust is (CGIHTTPServer )

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pxlpluker

    how robust is (CGIHTTPServer )

    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



  • Ryan Paul

    #2
    Re: how robust is (CGIHTTPServer )

    On Sat, 08 May 2004 21:02:29 -0400, pxlpluker wrote:
    [color=blue]
    > 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[/color]

    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.

    Comment

    • Andrew Bennetts

      #3
      Re: how robust is (CGIHTTPServer )

      On Sun, May 09, 2004 at 08:08:43AM -0400, pxlpluker wrote:[color=blue]
      > can anyone point out a good example of setting up a cgi capable twisted
      > web?[/color]

      from twisted.web import twcgi, server
      from twisted.applica tion import internet, service

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

      application = service.Applica tion('cgi-demo')
      sc = service.IServic eCollection(app lication)
      i = internet.TCPSer ver(8080, site)
      i.setServicePar ent(sc)

      if __name__ == '__main__':
      from twisted.interne t 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/c...ing-twistedweb for
      more details, or ask on the twisted-web mailing list
      (http://twistedmatrix.com/cgi-bin/mai...o/twisted-web).

      -Andrew.


      Comment

      • pxlpluker

        #4
        Re: how robust is (CGIHTTPServer )

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

        Ryan Paul wrote:
        [color=blue]
        >On Sat, 08 May 2004 21:02:29 -0400, pxlpluker wrote:
        >
        >
        >[color=green]
        >> 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
        >>
        >>[/color]
        >
        >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.
        >
        >[/color]

        Comment

        • Wilk

          #5
          Re: how robust is (CGIHTTPServer )

          pxlpluker <pxlpluker@cfl. rr.com> writes:
          [color=blue]
          > 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.[/color]

          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 SimpleHTTPServe r are good examples to show how to
          expand BaseHTTPServer.

          --
          Wilk - http://flibuste.net

          Comment

          • pxlpluker

            #6
            Re: how robust is (CGIHTTPServer )



            Wilk wrote:
            [color=blue]
            >pxlpluker <pxlpluker@cfl. rr.com> writes:
            >
            >
            >[color=green]
            >> 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.
            >>
            >>[/color]
            >
            >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.
            >CGIHTTPServe r and SimpleHTTPServe r are good examples to show how to
            >expand BaseHTTPServer.
            >
            >[/color]
            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?

            Comment

            • Wilk

              #7
              Re: how robust is (CGIHTTPServer )

              pxlpluker <pxlpluker@cfl. rr.com> writes:
              [color=blue]
              > Wilk wrote:
              >[color=green]
              >>pxlpluker <pxlpluker@cfl. rr.com> writes:
              >>
              >>
              >>[color=darkred]
              >>> 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
              >>>portabilit y reasons and maybe some future features that would not have
              >>>apache to realy on.
              >>>
              >>>[/color]
              >>
              >>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.
              >>CGIHTTPServ er and SimpleHTTPServe r are good examples to show how to
              >>expand BaseHTTPServer.
              >>
              >>[/color]
              > I think i need cgi to run python scripts though. I am allowing file
              > upload with some user management/accounts.[/color]

              Everything you can do with cgi can be done without...
              [color=blue]
              > What kind of traffic does your site get?[/color]

              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

              Comment

              Working...