--------------------- Building a CGI Script --------------------- A CGI script is a dynamically-generated web page. The content of the page is produced not from a static text file, but rather from the output of commands running on the web server. The content of the web page changes as the output of the commands change. You can build a dynamic web page using Unix commands. Here's how. 1) Create a public_html directory in your HOME directory on ACADAIX. Make sure it has read and execute permissions for everyone. 2) Put these four lines of text into the file public_html/who.cgi: The lines must start at the left margin. No indenting! (If you haven't learned any VI yet, use the method on the top of page 97 to create the who.cgi text file.) #!/bin/sh echo "Content-Type: text/plain" echo "" who Display the file to verify that it looks EXACTLY as above. 3) Turn on execute permissions (for you, group, and other) on the new file who.cgi file. Next, test the executable file at the shell prompt first: $ cd public_html $ ./who.cgi | more Verify that the first line of output is "Content-Type: text/plain". The second line must be blank. The rest of the output should be the output of "who". Fix any errors you find. 4) Enter a URL in this form into Netscape: http://acadaix/~abcd0001 Replace abcd0001 with your acadaix userid. If you get a permission denied error, add "x" permissions to your HOME directory to allow others to search it. Make sure the public_html directory has both "r" *and* "x" permissions for everyone. You should now see the name of your who.cgi script. Click on it to make the script execute. If you get a permission denied error, fix the permissions to allow others to read and execute the file. 5) Modify the end of the script to include any other Unix commands you might know, e.g. date, echo, ls, write, etc. Test the script from the shell prompt first, then finally try it from Netscape. At present, you cannot access your ACADAIX web page from outside the College because the ITS department doesn't allow anyone but ITS to run web servers on campus. The only web server you are permitted to access from off-campus is on NETSRV.