Am Sonntag, 9. März 2008 20:43 schrieb Paul Alfille: > ---------- Forwarded message ---------- > From: <[EMAIL PROTECTED]> > Date: Sun, Mar 9, 2008 at 3:29 PM > Subject: Simple perl program > To: Paul Alfille <[EMAIL PROTECTED]> > > > Dear owfs-developers! > > As recommended by you, Paul, I googled "cgi shell tutorial" and I found > some things. I get sites with "CGI" with "Rebol" or "Apache" and I wrote a > program like > > #!/usr/bin/perl > print "Content-type: text/html\n\n"; > print "Hello, World."; > > and put this into the folder "/var" into the NSLU2. Then, I gave it an > execute right and started it from the command shell. I get > " > Content-type: text/html > > Hello, World. > " > > O.k.Then, I entered the following URL in my web browser " > http://192.168.1.77/var/hello_world.pl", but of course it did not work. Do > I have to add a port or do I have to save it onto the hard-disc of my > computer and call it remote from the NSLU???? > > ANYWAY, I'M WILLING TO LEARN AND UNDERSTAND THE SYSTEM, BUT I HAVE ABSOLUTE > NO IDEA ABOUT ANY BASICS OF THIS "CGI" AND I HAVE NO IDEA IF I HAVE TO USE > THE "REBOL" OR THE "APACHE" CODE OR WHATEVER IT IS OR WHATEVER ELSE AND I > HAVE ABSOLUTELY NO IDEA WHERE TO START THE PROGRAM AND WHERE TO SEARCH IN > THE INTERNET FOR IT. > No need to yell.
CGI basics: 1. Write an executable program that produces a "Content-Type:..." header and two newlines. CHECK 2. Give executable permissions for the webserver (usually wwwrun) to it. Making it executable to anyone works, too. 3. Place the executable in a place where the web server finds it. If you run apache, this usually is <SERVER_ROOT>/cgi-bin/ 4. Enable CGI extension and the <SERVER_ROOT>/cgi-bin/ path in the webserver config. You should read the web servers documentation to find out how to do it. 5. Restart the Webserver/make it reload it's configuration. 6. Type http://<ADDRESS>/cgi-bin/hello_world.pl BTW: CGI does work with any programming language -- it's named *C*ommon *G*ateway *I*nterface. If you don't feel comfy with perl, you can choose any other language you like. Kind regards Jan -- We are Linux. Resistance is measured in Ohms.
pgpiB5P3FUP6V.pgp
Description: PGP signature
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers