473,394 Members | 1,721 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,394 software developers and data experts.

A simple Python CGI server?

Hi.

I'm just a hobbyist and I like mucking around with cgi scripts.

Here's the script I've been using......
#! /usr/bin/python

import BaseHTTPServer
import CGIHTTPServer
httpd = BaseHTTPServer.HTTPServer(('',8000),
CGIHTTPServer.CGIHTTPRequestHandler)
httpd.serve_forever()

For some reason, I get these weird permission errors sometimes when I use
it ... such as:

"OSError: [Errno 13] Permission denied"

Sometimes my scripts produce this error, sometimes they don't. Can anybody
explain this?

Also, can anyone direct me to a script on the web that might do the trick
a little more consistently?

Jul 18 '05 #1
2 8049
"Dfenestr8" <ch**************@yahoo.com.au> wrote in
news:pa****************************@yahoo.com.au:
I'm just a hobbyist and I like mucking around with cgi scripts.
did you look ak CGIHTTPServer.py's "test()" function? you can actualy run
that module to get your server.

[...] For some reason, I get these weird permission errors sometimes when I
use it ... such as:

"OSError: [Errno 13] Permission denied"

Sometimes my scripts produce this error, sometimes they don't. Can
anybody explain this?


on different scripts? or on the same wheny ou try it several times?
if its the former problem, make sure that you save all your cgis with
"#!/usr/bin/env python" (or similar) as the first line, make it executable
and world readable (chmod a+rx script.py")

chris

--
Chris <cl******@gmx.net>

Jul 18 '05 #2
On Sat, 01 Nov 2003 00:02:39 +0200, Chris Liechti wrote:
"Dfenestr8" <ch**************@yahoo.com.au> wrote in
news:pa****************************@yahoo.com.au:
I'm just a hobbyist and I like mucking around with cgi scripts.


did you look ak CGIHTTPServer.py's "test()" function? you can actualy run
that module to get your server.

[...]
For some reason, I get these weird permission errors sometimes when I
use it ... such as:

"OSError: [Errno 13] Permission denied"

Sometimes my scripts produce this error, sometimes they don't. Can
anybody explain this?


on different scripts? or on the same wheny ou try it several times? if its
the former problem, make sure that you save all your cgis with
"#!/usr/bin/env python" (or similar) as the first line, make it executable
and world readable (chmod a+rx script.py")

chris


Ta. It was a permission-related problem.
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Johannes Eble | last post by:
Hello Python community, I am trying the echo-client and echo-server examples in Chapter 10, "Programming Python" by Mark Lutz. It is probably the most simple sockets sample: A socket server just...
1
by: Bowen Chiu | last post by:
Dears: I use a 4KBytes HTML content to do this benchmark, it is just a simple test of python based web server. mod_python with Apache Lifting the server siege... done. Transactions: ...
4
by: Fuzzyman | last post by:
I'm looking to build a simple database application for use on the desktop (customer contact and feedback database). Anyone able to reccomend a simple module / package I can use... ? I've never...
0
by: Mike | last post by:
Hey! Im starting up a new python based project, its a very simple file tracker for our network. Some people would most likely call this a kind of asset management system but its much simplier...
2
by: Gelo Ilzi | last post by:
I'm trying to implement a very simple http server with cgi functionality. The code is simple: import CGIHTTPServer, BaseHTTPServer httpd = BaseHTTPServer.HTTPServer(('',8000),...
1
by: Thomas | last post by:
Hi, Sorry for the stupid subject, but here it goes: I need a simple Webserver which can 1. serve xmlrpc-methods 2. send multicast packets on local network to get response from a similar...
1
by: David Bear | last post by:
I would like some advice on what crypto lib to use. I am writing a cgi app that will store sensative data in a backend postgresql server. I have some simple numeric data I would like to make as...
2
by: nephish | last post by:
Hey there, i have been spending some time learning python. i do enjoy it so. Heres the deal. i need some dirrection advice. i have a friend that wants me to set up a customer database for him....
14
by: robert | last post by:
For testing purposes I'm looking for a simple DAV server - best a python thing serving a folder tree. Don't want to install/change/setup the complex apache dav .. Found PyDav...
2
by: bigodines | last post by:
Hi guys! I'm a complete newbie in Python and I'm trying to make a small software to watch my network. It will be a simple snmpget report for a specific machine. I would like to make a small...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.