CGI run locally?

Can CGI be run from a local machine?  Or does it have to be across the network?  If the answer is YES to the former, then please don't answer if you can't tell me HOW it's done (in which case I'll ++ the points).

Thanks,

Raydot.
LVL 3
RaydotAsked:
Who is Participating?
 
alamoConnect With a Mentor Commented:
Thanks, Raydot, glad I could help!
0
 
RaydotAuthor Commented:
Not across the network, across the Internet, is what I meant...

'Dot.
0
 
alamoCommented:
It does not need to be run over the Internet, but it does need to be run from a web server. You need to get a web server and install it on your own machine (there are free ones available). You would then access it with http://localhost/.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
moonlightCommented:
The Common Gateway Interface (CGI) is a standard for interfacing external applications with information servers, such as HTTP or Web servers. This means you got to go through your Http server for it to be run, (otherwise you could just type the command name at your shell) and that your CGI script is run on the server machine. No distinction is made between local and 'across the net' machine as long as they go through the server, which means if you consider the machine the server runs on, as local, then the answer is yes, and you access it exactly as anybody else. If you want the program however to run on the machine, where you have your webbrowser, then the answer is no. you can not. Then you must use java, preferably as an applet, or to use netscape's javascript language (if you want to discriminate internetexplorer users :) ), because you need a platform independent language.
0
 
alamoCommented:
Of course you can run a CGI program on the machine where your web browser is, as long you have a web server on the same machine. In fact that's by far the easiest way to test during CGI development.
0
 
moonlightCommented:
The part about not running it with your shell, is because you
get environments from the server that you can use. (and which you don't get if you run it from shell).the CGI script/program is as runnable as all other executables however. There is an exception going with that, if you have a NT web server, but working on a PC Lan, and don't have access to the NT machine, then you can copy others' CGI programs and have them in your CGI directory and make them work but can't actually run them on your pc and you can't make your own.

alamo: doesnt work with my machine, but I think you can always use file:///
0
 
alamoCommented:
moonlight, file:// won't work because it doesn't connect to the web server, it simply loads the file directly. If you install a web server on your machine then you can use that server to run CGIs on your machine - it doesn't work for you because you don't have a web server.

To rephrase what I said before, you don't need your machine to be connected to anything - the Internet or even a Lan - in order to run CGIs if you set your machine up properly.
0
 
ozoCommented:
http://localhost/
You could also set environment variables and run from your shell
0
 
RaydotAuthor Commented:
That's great, I'm even MORE confused.  I'm gonna think this over for a bit, and get back to y'all...hope you've checked your e-mail notification boxes...
0
 
sybeCommented:
Don't think too long, if you want to run CGI on your machine, then get a webserver program. There are a couple of them you can get for free (if you use windows95, you can install Microsoft Personal Web Server, but also O'Reilly's and some others are available).

For CGI you can use scripts (e.g. Perl) or executables (made in C++ or VB or whatever).

Perl for windows is also free.







0
 
moonlightCommented:
yep, http://localhost/ should work alright.
I don't have the server on my local machine, but
it should work for those who does nevertheless
0
 
RaydotAuthor Commented:
Here's the deal.  While Moonlight did come around to it eventually, it was Alamo's answer that got me to log onto Tucows and dig around for server software.  I found a piece of 1.5M software that allows me to run CGI scripts as if they were up on a server.  So I'd like to give the points to Alamo...

Sorry, M'light.  Alamo, please re-answer and the points are yours.
0
 
moonlightCommented:
sure, do what you want, but you hadnt asked for software
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.