| Our UNIX web servers have the
capability to run CGI scripts in your very own "cgi-local"
directory. Put your CGI programs in the cgi-bin directory.
When calling the programs from the web page, you must use
the alias for the cgi-bin directory. The alias is "cgi-[yourdomain]".
If your domain is example.com, then the alias is cgi-example.
Note that ".com" is not included. So the action
line from your form page would look like action="/cgi-example/program".
Put your CGI programs anywhere outside of the cgi-bin directory.
In this case, the program name must end in ".cgi".
Shell Scripts
Upload to your cgi-local directory to ensure proper file
permission settings. Upload in ASCII transfer mode (and NOT
BINARY mode). The first line of each script must read: #!/bin/sh
, #!/bin/csh. Reference the script using /cgi-local (and NOT
/cgi-bin) Always remember to include echo "Content-type:
text/html\n\n"
Perl Scripts
Upload to your cgi-local directory to ensure proper file
permission settings. Upload in ASCII transfer mode (and NOT
BINARY mode). The first line of each script must read: #!/usr/local/bin/perl
Reference the script using /cgi-local (and NOT /cgi-bin).
Always remember to include print "Content-type: text/html\n\n";
or alternatively using the Perl module CGI.pm (If you do not,
your scripts will not run and you will get an Internal Server
Error message).
use CGI qw(:cgi-lib :standard);
print header();
Paths to Date, Sendmail, Perl, etc
Sendmail: /usr/lib/sendmail
Perl5: #!/usr/local/bin/perl
Serverpath: /home/username/domain-www/cgi-bin
Root path: /home/username/
(puts you in your the root of your account)
Domain directory: /home/username/public_html
(puts you in your public_html directory)
Cgi-bin path: /home/username/public_html/cgi-bin/filename
(puts you in your cgi-bin) |