So, now return to your home directory and create a private area for program development.
~/public_html/> cd ~/> mkdir private ~/> chmod go-rwx private ~/> ls -ld private drwx------ 2 joeuser students 1024 Sep 4 17:45 private
Since you are probably taking other courses besides the CGI class, it is best not to put your work files in this directory itself. Instead, to keep things organized, you should create a different subdirectory for each class you are taking. For the CGI class, create a directory called cgi. Note that it is not necessary to give this directory any special permission, since it is protected simply by being within the private directory.
~/> cd private ~/private/> mkdir cgi ~/private/> ls -ld cgi drwxr-xr-x 2 joeuser students 1024 Sep 4 17:46 cgiNow, to work in this directory, do cd cgi and run pico or another text editor to create and modify program scripts and source files.
One more step is done solely for convenience. After creating and debugging a CGI program in the private/cgi directory, you will want to copy it over to the public_html/cgi-bin directory. Since these two directories are rather widely separated in your directory tree, it will be convenient to create a symbolic link to make it easy to do the transfer. A symbolic link is a special file that ``points'' to some other location. References to the link are resolved into references to the place it points to. Here is how to do it:
~/private/> cd cgi ~/private/cgi/> ln -s ../../public_html/cgi-bin bin ~/private/cgi/> ls -l bin lrwxrwxrwx 1 joeuser students 12 Sep 4 17:48 bin -> ../../ public_html/cgi-binNow, if a CGI program, say hello.pl, is created in the private/cgi directory, you can ``publish'' it by copying it to the bin directory, which will really be public_html/cgi-bin:
~/private/cgi/> cp hello.pl binThis saves you the trouble of typing ../../public_html/cgi-bin as the destination directory each time you do this operation.