You will need at least an FTP client and a Telnet resource. You can usually find both of these in a Windows 95 environment by searching for WS_FTP.exe, or the expression "telnet*". If either is not available, then go surfing (search for "telnet client" for instance, or ask a friend to help you get set up. If you're using the computers in DML, I believe it should work if you simply open the RUN window and type telnet <hostname> or ftp <hostname>. I'll tell you the host name in just a minute.
STEP 1: The small piece of paper which I gave you provides your user name. Get your computer started, and direct your telnet toward the host
nemesis.creat.cas.ucf.edu
When you see the login prompt, type the userid you were given. Your initial password is also given on the paper.
NOTE: Some hosts (including magicnet, my ISP) are having trouble reaching nemesis. Apparently a recent change of ip address has not yet been propagated to the domain name servers. You can try it directly at 132.170.116.240. If this doesn't work, try telnetting into pegasus (or some other service you might have access to) and THEN telnet to nemesis.creat. etc. I did this successfully through eola.cs.ucf.edu, but you may not have an account there.
If you can't get in, then don't worry about it. But give it a good try. If you cannot telnet to nemesis, then you probably won't be able to reach it via www.creat.cas.ucf.edu either; but some of the time this afternoon the www.creat pathway was working even when the telnet to nemesis wasn't.
As soon as you successfully log in, type
passwd (return)
and follow the directions for setting a new and personal password. Please MAKE SURE you write it down somewhere because we cannot recover it for you, and it's a hassle to make a new one.
STEP 2: Your scripts are going to run in a subdirectory named cgi-bin, within your own directory. So make it now, by typing
mkdir cgi-bin
Then have a look (type ls -l) (those are ells not ones) to see that it has the following properties
rwxr-xr-x
Which, in octal, is abbreviated 755. (Get it?) The octal digit 7 is
111 in
binary, and the three bits are 'r' for read, 'w' for write and 'x'
for execute. The three octal digits are for yourself, your group and the
public. So 755 means you can do anything to the cgi-bin directory, whereas
others can only read and execute it. (It's not meaningful to execute a
directory of course.)
If you don't see rwxr-xr-x next to cgi-bin, set the mode as follows:
chmod 755 cgi-bin
STEP 3: Now let's try running the first 'hello' program, which is located in the moshell directory. Start up Netscape or Internet Explorer, and access the following url (come to think of it, you're in the browser now! Let's make this a link:)
http://www.creat.cas.ucf.edu/cgi-bin/cgiwrap/moshell/hello.pl
When this runs, you will see a simple message. It doesn't do anything fancy, it just sends some HTML up to your browser.
What isthis long complex URL about? It's a typical Internet path name, until you get to cgi-bin/cgiwrap. That's not in your cgi-bin directory; it's in creat's own private directory. It is a special 'wrapper' which makes it possible for your cgi program to run with minimal hassles, even though it's being run by a stranger (the web browser of anyone who accesses this url) rather than by its owner.
Here's the simple minded hello program:
print"Content-type: text/html","\n\n";
print "<HTML>","\n";
print "<HEAD><TITLE>Your first Perl Program</TITLE><HEAD>","\n";
print "<BODY><H1>CAP 4020 - Spring 98</H1>","\n";
print "<HR><PRE>";
print " ** \n ";
print " ** \n ";
print " ** \n ";
print " </pre>That was preformatted asterisk stuff.\n";
print " Now your first Perl program is running. Go for it!.\n";
print "<p> See you later - M. Moshell\n";
print "<HR></BODY></HTML>","\n";STEP 4: Copy the program from my area to yours. Here's how. I assume your point of view is inside your cgi-bin directory.
copy ../../moshell/cgi-bin/hello.pl .
The ../ means "go down one level in the tree". So you back out to the common node that contains my directory and yours, then up again to my cgi-bin directory.
Check its privileges, once it gets to your area, with a ls -l command. Fix them if necessary.
STEP 5: Now try accessing your copy of the file using your www browser, by replacing 'moshell' in the long URL above, with your login id.
STEP 6: Now modify the program in some way. To do this, you will either need to know how to use a Unix editor through your Telnet, or use your ftp client to download the file; edit it with any editor of your choice, and put it back up again.
Modify it in some way such as putting your own text where it says "See you later." This just proves you have managed to modify the program. Then verify that it will run.
STEP 7: There's another little program in the moshell directory, called systell.pl. It reports some system information. Give it a try, too. This one is courtesy of joe bloch, our Unix administrator.
That's it for now. We'll dive into Perl syntax on Tuesday.
JMM