![]() |
This part of the NovaTech Web Services CGI Support Pages is for beginners mainly, but if you are new to NovaTech Web Services's hosting services, please read, or at least skim, this page. It focuses on Frequently Asked Questions (and their Answers). There are many questions answered here, so please check the entire page.
| What are scripts? | Perl, and C++ scripts are programs that run on a web server that are designed for specific functions. For example, the counters, feedback forms, random pictures and text, and so forth are all brought to you by some kind of script. Yahoo! and the other search engines are also powered by CGI scripts in a sense. |
| What is Perl 5? | Perl is the
most common web programming language for CGI scripts. When looking for
scripts, it is generally advisable to look for Perl scripts. The number
5 in Perl 5 represents the version of Perl. Most scripts require version
5 or greater. The current version running on NovaTech Web Services's servers
is Perl 5.003x.
For you tech junkies, Perl 5 is an interpreted language basically meaning that every time that a Perl script is called, the Perl interpreter reads the Perl script and executes the script. This means that interpreters can be made for different types of machines, but the Perl script does not have to change generally (some interpreters do not implement the functions in the same manner as other interpreters do causing some problems). In comparison, C++ scripts are compiled for each specific machine. Compiled C++ code is mainly faster because when the C++ script is compiled, the script is translated to code that the specific machine understands. C++ scripts are sometimes harder to setup without the actual source code though and any modifications you need to be made will require the script's source code. There are many different advantages and disadvantages when using either Perl or C++ scripts. |
| What
are CGI scripts? Why
are some called CGI scripts, others Perl scripts, and others VB or C++ scripts? |
CGI
is basically like a gateway or door between the web server and the Perl
or C++ scripts. This gateway allows the web server and the scripts to communicate.
Scripts that use CGI are commonly referred to as CGI scripts.
Some people call scripts based on their language that they use. Perl scripts are scripts that are programmed in Perl for example. CGI scripts refer to any script that uses CGI. Perl scripts and C++ scripts do not have to use CGI, but most that are running on web servers do use CGI to some extent. You can think of CGI scripts being a general term while Perl and C++ scripts as more specific identifiers. |
| Where can I find CGI scripts? | Besides
the ones that you can freely download at this support web site on the Scripts
page, you can find other freeware, shareware, and commercialware scripts
available on the Resources and Links
page. Scripts are not guaranteed to work on NovaTech Web Services servers,
but we'll try our best at getting them to work.
Custom programming is available by quotation from NovaTech Web Services. |
| What are ASP and Cold Fusion? | ASP
is the acronym for Active Server Pages. This fairly new Windows server
technology is from Microsoft,
and it is a server side technology meaning that only the server needs to
support it for end users/visitors to see the results. Using special code,
the server can execute the code to perform some amazing feets. NovaTech
Web Services can support ASP, but there may be a small fee. Please see
NovaTech Rate Plans for more
details. These support pages do not support ASP due to the fact that SSI
and CGI scripts which are supported by many different platforms fill the
same role for the most part and there is more flexibility with SSI and
CGI scripts.
Cold Fusion by Allaire is another server side technology. It is basically more like a database server technology that has special markup code like ASP, but Cold Fusion can do many more different tasks. Unfortunately, teaching Cold Fusion is beyond the scope of these support documents. NovaTech Web Services can support Cold Fusion, but there may be a small fee. Please see NovaTech Rate Plans for more details. |
| What are ASCII and BINARY modes? | Files
are uploaded mainly via two different modes. ASCII mode or text mode is
for text files such as Perl scripts or HTML files which are text files
that can be read by your friendly NotePad or text editor. Binary mode is
for data files such as ZIP compressed files, database files, etc. If you
upload text files in binary mode or binary files in text mode, you risk
damaging the files.
FTP programs such as CuteFTP or WS_FTP (available at your local shareware file archive) should automatically upload scripts in ASCII format. If they do not automatically upload in ASCII format, set the text files extension to include .pl and .cgi files. View your program's help file for more information. |
| What is sendmail? | Sendmail
is a UNIX program that CGI scripts use to send e-mail. Common CGI programs
that need Sendmail include feedback forms. Because NovaTech Web Services
uses Windows NT systems, sendmail is not available. However, there are
equivalents available that can be used. Scripts may need slight modifications
because the current program used to simulate sendmail (WSendmail)
is not exactly the same as the actual sendmail program.
If you need a feedback form mailer, please check out what is currently available on the scripts page. |
| How do I learn Perl? | You can learn Perl by picking up various books available at your local bookstore. The Teach Yourself Perl in 21 Days book is recommended as well as the Perl 5 Interactive Course book. |
| What system is Novatech Web Services Running? | NovaTech Web Services is running multiple Windows NT servers. These systems are not UNIX systems. Some commands are not equivalent to UNIX systems. File Locking, chmod, chown, and other commands are examples of commands that do not work or do not function in quite the same manner as the UNIX equivalents. |
| Where is the Perl interpreter? | Because Windows NT systems associate .pl files with the Perl interpreter, you do not need to change the #!/usr/local/bin/perl line. Leave the line in, but you do not need to change it. |
| What file extension should I use? .cgi files keep giving me errors! | You should use the .pl extension for Perl scripts. The .cgi extension is not registered to Perl scripts because .cgi is associated with many different types of scripts on different servers. |
| What CGI scripts are allowed? | If
you are registered for a full domain package, you should have your own
cgi-bin allowing you to run any script. However, please do take
into account that your server is shared by others and that your programs
do take processing time away from serving web pages, images, files, and
anything else on the server. Please read the NovaTech Web Services Policies
and Guidelines available at the main web site.
If you do not know what your CGI script does, do not run it. Malicious scripts are sometimes found on the web. Do not run any script or upload any script that you believe contains malicious code. If you are not sure, post a message to the WebBoard and the source code of the script. Any script that creates, modifies, or deletes directories and files is potentially dangerous. There are security measures in place, but this is a general warning for all scripts. |
| What directory should I place my CGI scripts in? | Here
is an outline of your basic directory structure:
drive letter:\users\username\username.com\
Replace "drive letter" and "username" with the drive that you are on and the username that you have been given. The username is generally the same as your domain name. That's a lot of directories. What directory should you place CGI scripts in? Generally, place all CGI scripts in your \cgi-shl directory. It is advisable to make directories for each script to separate individual scripts. Placing files in \cgi-shl-prot will be more secure and protected meaning that users will not be able to grab the script source and data files, but they can still run the CGI script. The other directories are for specific programs. You should not use them unless you know a script that specifically requires one of the directories above. You cannot run scripts outside your CGI-BIN directories. Also, on another note, anything placed inside the cgi-bin directories must be either a data file or an executable CGI script. They cannot be HTML files. You need to place your HTML files inside your \htdocs directory and separate your CGI script from the HTML files that use the CGI script. |
| How do I call my CGI script? | Assume
for this example that you placed your FormMail script at the following
location:
e:\users\foo\foo.com\cgi-shl\formmail\formmail.pl Now, to call this CGI script, you will need to call it from the following URL: http://www.foo.com/cgi-shl/formmail/formmail.pl This works for every cgi-bin directory. |
| What about cron tab jobs? How do I automatically run scripts on a regular schedule? | You will need to e-mail the system administrator, for information on running programs on a regular basis. |
| What is SSI? | The
acronym stands for "Server Side Includes". Basically, specific commands
are included in HTML files which are executed on the server.
SSI is useful in many different ways. Suppose you need a menubar on a set of 100 pages, and you do not want to have to go through every page to update every time that menu bar changes. Server side includes can be used for that task (the #include command specifically). Or, suppose that you want a time date like when the last time your page was modified to be included on a page. You can use SSI for that (#lastmod). And finally, another common use is for those that want to include inline CGI scripts like counters, so instead of having your page run through a CGI script every time causing massive memory resource consumption, you can place a call to a CGI script that just returns the counter number for text based counters or HTML code for a graphical counter which causes less memory consumption. |
| What about XSSI? | XSSI stands for "eXtended Server Side Includes". This is an extension of the original SSI specs. It is not currently supported by NovaTech servers because it is of limited form and proprierty to specific servers. |
| How do I use SSI? | You
need to learn the specific SSI commands, but besides that, you need to
rename .html files to .shtml files (or .htm files to .shtm files).
HTML files have higher precedance than SHTML files. For those that use index.html files so that users can browse directories such as http://www.foo.com/ or http://www.foo.com/dir/, and they do not see the index.html or index.htm file, this is a general warning. If you use SHTML files particularly index.shtml or index.shtm, then make sure there is not an index.html or index.htm file in the same directory. The index.html file will always be loaded instead of the index.shtml file if it exists.There are several SSI commands available for your use. There are no restrictions in place. Here is a list of the more common ones, examples, and applicable uses. The basic SSI tag is below: <!--#<tag> <variable set>--> <!--#include
virtual="/path/to/file"-->
The menubar to the left uses the include path. The original menu bar file is located at http://www.NovaTech.net/support/scripts/menubar.html. The SSI code is the following: <!--#include
virtual="/support/script/menubar.html"-->
You must base the /path/to directory starting from your htdocs directory. For example, suppose that your domain name is foo.com at http://www.foo.com/. Now, you want to include a file at http://www.foo.com/menu/test.txt. From any SHTML file you can paste the following SSI code, and the file test.txt will be included. <!--#include
virtual="/menu/test.txt"-->
The file to be included must not contain the extension .shtml or .shtm which is a safety measure (think of the problems when the original .shtml file (file X) includes another file (file A) which has a call to the original .shtml file (file X)). It protects from infinite loops such as the one described. You can name the file to be included any file name you want with any extension except .shtml or .shtm. <!--#flastmod virtual="index.shtml"--> This SSI command gives you the last date and time that the file specified in the file variable was modified. This command must be given within the same directory or within a "super"-directory. Here is the last date that this index.shtml file was modified:
The SSI code used is the following: <!--#flastmod virtual="/support/scripts/basics/index.shtml"--> You might find this useful on news pages at the top of your page or as a regular footer so that visitors can find out the last date that your page was modified. <!--#exec cgi="/cgi-shl/script.pl"--> This SSI command is for SSI-enabled CGI scripts. You must start with /cgi-shl/ for the directory. <!--#exec cgi="/cgi-shl/counter/counter.pl"--> The above is an example of how you can call an SSI textcounter script. It should return with a number that will print with your content. |
| Main Support Page | The Basics | Tested Scripts | Resources & Links |
| Technical Support Message Board | |||
| Features | Rate Plans | Support | Contact |
| References | Resellers | Order | Home |