Lesson 2

Linux / Apache / GT.M / Web Application Lesson 2 By Ben Irwin, Copied from: http://www.doggiedudes.com/fscc/list.htm

Tutorial Home: M Web Tutorials Prev: Lesson 1 Next: Lesson 3

In Lesson 1 we placed the following cgi script file in the cgi-bin directory for our web server. When we called it using the web server it just wrote "Hello world!" to the web page and put the title "Hello world demo." in the web browser title bar.

library.sh1 echo Content-type: text/html echo
 * 1) !/bin/sh

echo " " echo " " echo " " echo "Hello world demo." echo " " echo " " echo " " echo "Hello world!" echo " " echo " "

If we run the cgi script from the Linux Prompt using the following command: library.sh1 or ./library.sh1 depending on your Linux setup you should get the following listing.

Content-type: text/html Hello world demo. Hello world!

The "Content-type: text/html" line tells the browser to treat this document as a html file.

Html tags usually go in pairs one to start a section and another to end a section.

The  tag starts the html page. The  ends the html page.

The  tag starts the header section. The  tag ends the header section.

The  tag starts the title section. The  tag ends the title section.

Well, I guess you get the idea.

The important concept to learn from this lesson is that what prints to the screen when a cgi script is run at the Linux Prompt is the same information that gets sent to the web browser.

Tutorial Home: M Web Tutorials Prev: Lesson 1 Next: Lesson 3