[Tutor] How do you simulate a CGI script locally?

Magnus Lycka magnus@thinkware.se
Fri Dec 13 18:37:02 2002


At 14:37 2002-12-13 -0700, Bob Gailer wrote:
>>But then I substituted my static IP address for localhost (example 
>>http://222.111.333.44:8000/cgi-bin/script.py). If the web server is 
>>running the browser hangs saying "loading". If the web server is not 
>>running the browser immediately reports that the connection was refused. 
>>What do I need to fix here?

I hope you don't have an IP address with 333 in it. ;)

Does it work properly to ping this address? Telnet to
it?

C:\> telnet 222.111.333.44 8000
should give a blank screen. Type "GET /" followe by [ENTER]
in the dark (it won't be echoed). After a little while
you should see HTML code followed by "connection to host
broken".

It all works for me. But I think IE (or is it windows?)
is sometimes very grumpy with these local names. Whatever
happens, I doubt it has anything to do with any python
code.

I can use either of

http://nida:8000/
http://192.168.XX.XX:8000/
http://localhost:8000/

locally, or

http://nida:8000/
http://192.168.XX.XX:8000/

remotely on Windows 2000.

Be very careful to allways prepend the URL with "http:"
when entering local addresses in MS IE. Just "nida:8000" or
"192.168.XX.XX:8000" will get transmogrified to the full
version (beginning with "http://") if I type it in on another
machine, but not if it happens to be the address of the
machine I'm typing it in to. Another reason to switch to a
real operating system? Oh well, in a few years we can run
MS Linux and get the best of both worlds...or will we? Or
will the version of Windows after XP simply be based on
BSD? (Who cares. An OS should be Unix, just as a car should
have the accelerator to the right, the break in the middle
and the clutch to the left. (A clutch is a device used in
non-American cars to make switching gears into a dexterious
feat instead of something the car handles by itself. That's
the way we like it. ;) )


-- 
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se