Silverhawk's Internet Services

Online Support Manual

CHAPTER SEVEN - CGI Scripting

Online Manual Index

CGI-bin Scripting 
   Overview
   Adding CGI Scripts
   CGI Script Resources
   Where to Put CGI-bin Scripts
   Quick Guidelines for Using SSI's
   PermissionSettings For Provided Scripts
      wwwboard Permission
      Guestbook Permission
      Free For All Links Permission
      Graphic Counter Permission
      Cgi-bin Permission
      Random Text Permission
      Password Admin Permission
     Cgiwrap--Secure Server CGI Wrapper

 

CGI Scripting

Overview
CGI stands for "Common Gateway Interface,". What this means is that they are programs that are commonly run on a server when a web browser invokes them from a web page. This means that the web browser does not need to have any fancy viewers or plugins for the CGI program to run.

The CGI Scripts provided for you are basically self-contained. There is little, if anything, that needs to be done to them to make them operate.  The complicated part for most users trying to add cgi scripts is file paths and permissions.  Even experienced programmers and webmasters struggle at times to properly configure cgi programs. If you are a Novice User with limited knowledge in this area, it is strongly recommended that you first become highly proficient with HTML and web page creation before attempting to do this yourself.

Adding CGI Scripts 
We provide many CGI scripts with your account which you will find in a directory called cgi-bin.   We do not provide free support for CGI scripts which we do not install on your server, so if you wish to add new CGI scripts you may want to do a bit of research on them first unless you are familiar with them already. Adding new scripts requires a more advanced knowledge of programming terms and skills and is not generally recommended for Novice Users.

If you are an experienced user, (or a novice who myopically decides to install your own scripts) you can access more technical cgi information in the Advanced User section of this manual.

Go To Top of Page

CGI Script Resources
There are many good resources for CGI scripts found on the web. The scripts at Matt's Script Archive found at http://www.worldwidemart.com/scripts/ are very good. Many of our scripts come from there. Another excellent resource is The CGI Resource Index found at http://www.cgi-perl.com/   Unless you are an expert on the subject, you should look for scripts that are very well documented and come with step-by-step instructions.  You may contact us for help or installation.

Where to Put CGI-bin Scripts
Put your cgi-bin scripts in the www subdirectory named "cgi-bin". 

Go To Top of Page

Quick Guidelines For Using SSI's
No! We are not talking about a Social Security Income check from uncle Sam!  SSI stands for Server Side Include... and it means that you can insert the contents of another web page, program or file into the web page that adds the Server Side Include.

A couple of important points you need to follow for SSI to work on your domain.
1.   The web page that adds the SSI instruction to include another page or program MUST end with .shtml or .sht rather than .html or .htm. 
2.  The URL to the page you want to insert must be relative to the current web page rather than a full URL.

The SSI feature on your domain is limited to what is known as a "exec cgi command". This simply means that you can insert into any page the ability to execute any cgi program. The format for a Server Side Include is:
<!--#exec cgi="/cgi-bin/THE-PROGRAM-NAME-HERE.cgi"-->

One quick observation... do you notice how this SSI instruction uses a *relative* URL (/cgi-bin/....) instead of a FULL URL? This is very important to keep in mind when using SSI.

For example, let's say we want to include a counter program (that has the name, counter.cgi) on our home page, called normally index.html.  Remember! Because we want to add a SSI instruction in our home page, it must end with .shtml or .sht. In this case, we would name it index.shtml.

The counter program is named counter.cgi, and like all cgi programs, this program is found in the cgi-bin directory of your domain. 

So the SSI instruction to include on your web page, where you want the counter to be displayed is:
<!--#exec cgi="/cgi-bin/counter.cgi"-->

Go To Top of Page

Permission Settings for Provided Scripts
All of the cgi scripts provided as part of your domain have been setup and configured properly.  As mentioned earlier, one of the most difficult tasks of dealing with CGI programs is correct settings of file permissions.  Listed below are the default permission settings for the installed CGI programs.

 

wwwboard Permission

bbs dir chmod 755
bbs/messages chmod 755
bbs/index.sht chmod 666
bbs/data chmod 666
cgi-bin/wwwboard.pl chmod 755

Guestbook Permission

Guestbook dir chmod 755
Guestbook/guestbook.cgi chmod 755
Guestbook/guestbook.setup chmod 666
Guestbook/guestbook.html chmod 666

Free for all Links Permission

links dir chmod 755
links/links.htm chmod 666
cgi-bin/links.pl chmod 755

Graphic Counter Permission

counter dir chmod 775
counter/logs chmod 777
counter/ all other files chmod 666
 cgi-bin/counter chmod 755

Cgi-bin always chmod 755 all scripts chmod 755 in main bin

cgi-bin/counters (text counter) chmod 755

Random Text

random dir chmod 775
random/random.txt chmod 666

Password Admin

password dir chmod 755
All password files chmod 666

Go To Top of Page


Cgiwrap--Secure Server CGI Wrapper
Your domain includes secure server access, allowing you to collect customer information in a secure fashion.  Since you might also want to run a cgi program in secure mode, we make available Cgiwrap - a system that allows safe, secure use of cgi programs. We have created a sort short cut for this as well.

When you want to use a cgi script or program in secure mode, you
must change the URL to follow this format:
https://machine.safe-order.net/cgi-domain/script.cgi

Machine - that is the machine name that is hosting your domain.
cgi-domain - replace the word domain with your domain name.
script.cgi - use the name of the cgi script located in your cgi-bin directory.
For nph-style scripts, use nph-cgiwrap or nph-cgiwrapd instead.

Go To Top of Page


Online Manual Contents