Contents:
| General Information |
| More Technical Information |
| suexec |
| CGI Library |
| Server Side Includes |
| Trouble-shooting |
| Example Script |
| Links to Other Resources |
Our servers have the capability to run CGI scripts
based on Perl, Unix SH, BASH, KSH, CSH, and C/C++ languages. Perl is a our language of
choice for most applications as it is a world standard and is well suited to CGI. In
addition, Perl code does not require manual compilations whereas C/C++ code must be
compiled on our web servers prior to use.*
If you have a custom CGI script that you need to use, simply upload it to your personal
"cgibin". Here are some helpful tips to follow when installing Perl scripts:
Utilize any directory except "cgi-bin" for your own scripts.
We recommend placing them in your cgibin directory to help consolidate them.
Upload in ASCII transfer mode (and NOT BINARY mode)
Those using Fetch should use Text mode (not Raw Data)
The first line of each script should read: #! /usr/local/bin/perl
(please also see below)
One exception is if you are using PerlShop, it should read:
#! /usr/local/bin/perl5.003
Reference the script using "cgibin", NOT using "cgi-bin"
Use ".cgi" extensions for all scripts
If a script calls another file within your account, but the script does NOT
require a URL, you need to use the system path.
/web/guide/<domainname>/...
<- if file resides in root
/web/guide/<domainname>/cgibin/...
<- if file resides in cgibin
Substitute the path to the file beginning with your domain name. Your domain name is the
directory name of your account.
Long Winded
Really Long Winded
/usr/local/bin/perl5.001
/usr/local/bin/perl5.002
/usr/local/bin/perl5.003
/usr/local/bin/perl5.00307
/usr/local/bin/perl5.00404 = /usr/local/bin/perl*Some newer servers will not have these earlier versions available. In this case, use the default:
/usr/local/bin/perl
| www#:/mnt/web/guide/domain/cgibin# dir | ||||||||
| drwxr-xr-x | 3 | user | bbsuser | 512 | May | 31 | 15:20 | . |
| drwx--x--x | 32 | user | wheel | 1024 | Jun | 3 | 10:24 | .. |
| -rwxr-xr-x | 1 | user | bbsuser | 5780 | May | 31 | 15:20 | search.cgi |
| -rwxr-xr-x | 1 | user | bbsuser | 69392 | Jun | 3 | 10:24 | cgiemail |
chmod 755 file.cgi
chmod 644 file.shtml
http://www.apache.org/docs/mod/mod_include.html
perl -w file.cgi
#!/bin/sh echo Content-type: text/plain echo echo 10 print "HELLO" echo 20 goto 10 echo Hello there I see you saw my page at $HTTP_REFERER echo You are using $HTTP_USER_AGENT as a browser. echo $HTTP_USER_AGENT >> agentfile.txt echo \<a href=\"http://mydomain.com\"\> Home \</a\>
Yawn - Notice the \ escapes, the blank echo after the content-type line. Also If you want to use agentfile.txt line, I had to upload a blank file called agentfile.txt, and then use the file manager to set PUBLIC WRITE on that file. Or the script will not work! (telnet: touch agentfile.txt;chmod o+w agentfile.txt)
Galaxy's CGI- Common Gateway Interface
- Lots of information on CGI scripting, and the longest URL on the Web, including
pointers for more information on image mapping, etc.
Julia
Martinson's Collection
- a great collection of information on CGI & HTML.
O'Reilly & Associates
- Don't normally recommend books, but in the case of Perl, Unix, Linux, Scripting,
etc. your might need to read-up with the best.
The Common
Gateway Interface
- An introduction (with examples) to CGI scripting. One of the best sites.
Shareware
CGI Scripts
- Consists of scripts for Guestbooks, Forms, and Counters. Includes some Apple
programs as well.
FeLIpe's Applescript CGI
Examples
- An Apple reference to CGI-Scripting with examples. We're not Mac-users at Computer
Pal, Inc., so I haven't tested this site out. Mac people, let us know what you think.
CERN HTTPD
- Resources for image-mapping, scripts, forms, search engines, CGI, etc. Please note
that this is not our server, though similar, and some of the steps (BIN
references) are different. Please refer to our FAQ for specifics on this.
Accessory Scripts-
CERN
- Reference for forms submissions, etc. Again, the references are going to be slightly
different for our server and please refer to our FAQ documentation for the changes needed.
The processing of CGI
arguments under TCL
- More information on CGI.
Accessory Scripts-
CERN
- Reference for forms submissions, etc. Again, the references are going to be slightly
different for our server and please refer to our FAQ documentation for the changes needed.
Imagemap Help Page
- Imagemaping made simple in an easy to follow guide.
HTGREP
- if you need a searchable index, this is supposed to do the trick. I haven't messed with
it yet, though.
NASA's 'Information on
Search Tools'
- a interesting page with many ideas on solving local searching problems.
PERL
- A great language to learn in the generation of dynamic documents (on-the-fly page
creation) such as forms.