473,320 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

Jul 18 '05 #1
6 2848
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
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
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
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


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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: vincent delft | last post by:
I'm using Python 2.2.2 the standard cgihttpserver (example given in the python doc). All HTML and CGI work. BUT by writing a simple python-cgi script like this : " #!/usr/bin/env python...
0
by: Andy Worms | last post by:
I'm using CGIHTTPServer to try some scripts, apparently as a first step of building a real server. The CGIHTTPServer source code has a comment that warns of potential security problems: SECURITY...
3
by: vincent wehren | last post by:
Hi, as a small capabilities demo I coded the piece below to show how to use Python for cgi'ing on localhost and it more or less does the trick :-). However, I when I freeze it with py2exe,...
3
by: William D. Gill | last post by:
I use a notebook (win 98) because of its portability. Unfortunately it is very slow. When I try to develop and test python cgi scripts I use Xitami as a local server, but with python, Xitami, and...
1
by: Sullivan | last post by:
When I run a CGI script (Python) with Python's CGIHTTPServer, it should run with the UID of the user 'nobody' (as the documentation says). But if I let the CGI script e.g. create a file, it...
1
by: Thomas Guettler | last post by:
Hi, The CGIHTTPServer returns self.send_response(200, "Script output follows") before it starts the cgi process. This means you cannot set the status header to 302 for a redirect.
2
by: Johan Kohler | last post by:
Hi, I'm using CGIHTTPServer (via its test() method) to test some CGI on my Windoze 98 box. I find that the execution is very slow. Is there anything I can do to make sure I'm getting the best...
1
by: Alvin A. Delagon | last post by:
I'm a simple python webserver based on CGIHTTPServer module: import CGIHTTPServer import BaseHTTPServer import SocketServer import sys import SQL,network from config import * class
1
by: mpc | last post by:
hello, how does one run a PHP page with a python webserver? Lets say i have a simple python web server running /path/webserver.py #!/usr/bin/env python from BaseHTTPServer import HTTPServer...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.