We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

CGI run locally?

Raydot
Raydot asked
on
Medium Priority
210 Views
Last Modified: 2013-12-25
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.
Comment
Watch Question

Author

Commented:
Not across the network, across the Internet, is what I meant...

'Dot.

Commented:
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/.
moonlightSenior Technology Consultant
CERTIFIED EXPERT

Commented:
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.

Commented:
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.
moonlightSenior Technology Consultant
CERTIFIED EXPERT

Commented:
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:///

Commented:
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.
ozo
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2015

Commented:
http://localhost/
You could also set environment variables and run from your shell

Author

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...

Commented:
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.







moonlightSenior Technology Consultant
CERTIFIED EXPERT

Commented:
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

Author

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.
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
moonlightSenior Technology Consultant
CERTIFIED EXPERT

Commented:
sure, do what you want, but you hadnt asked for software
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.