By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,235 Members | 1,022 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,235 IT Pros & Developers. It's quick & easy.

how robust is (CGIHTTPServer )

P: n/a
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

Jul 18 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
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.
Jul 18 '05 #2

P: n/a
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/c...ing-twistedweb for
more details, or ask on the twisted-web mailing list
(http://twistedmatrix.com/cgi-bin/mai...o/twisted-web).

-Andrew.
Jul 18 '05 #3

P: n/a
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.


Jul 18 '05 #4

P: n/a
pxlpluker <px*******@cfl.rr.com> 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
Jul 18 '05 #5

P: n/a


Wilk wrote:
pxlpluker <px*******@cfl.rr.com> 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?

Jul 18 '05 #6

P: n/a
pxlpluker <px*******@cfl.rr.com> writes:
Wilk wrote:
pxlpluker <px*******@cfl.rr.com> 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
Jul 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.