CGI Scripts

CGI scripts are used to process information on your web site. Think of scripts as mini-programs that execute on the server to accomplish tasks. Each mailform, counter, guestbook, or other interactive feature you place on your site must not only have an HTML page, but also a script that works behind the scenes to process the information.
  • Our servers support Perl scripts easily. Other scripting languages, such as C, require the script to be compiled on a system running the same version of Unix as the server before they will function. So, if you do not have access to a BSDI or Solaris Unix server, you will most likely be limited to Perl scripts for your account.

  • For your convenience, ValueWeb provides script-making utilities on your account Control Panel (at http://www.yourdomain.com/stats). These tools allow you to setup common ready-made scripts right from the Control Panel, which will be placed on your web site, ready to use! The Control Panel has tools for creating hit counters, mail forms, guestbooks, password protected subdirectories, searches, free-for-all pages, random link pages, and so forth. Using these tools, you may not have to upload your own scripts at all.

  • Also available on the Control Panel is a Perl Script Validation utility that will compile and test any Perl script in your cgi-bin, and provide a list of errors in the script.

  • In addition, the Control Panel has a tool that will remove the control characters, such as CTRL-M's, from any script that you may up inadvertantly uploaded in 'Binary' mode.
When uploading Perl scripts to your account make sure that they are uploaded to your cgi-bin directory and that you upload them in 'Ascii' mode; not 'Binary' mode. The cgi-bin directory is located off of your root directory. Also, you should make sure that you have the proper permissions set on your Perl scripts. Usually they are set as the following:


Information commonly needed for perl scripts:
  • Path to perl: /usr/bin/perl
  • Version of perl: 5.004.04
  • Path to sendmail: /usr/lib/sendmail
  • Operating system: Solaris 2.5 (older accounts), and BSDI (newer accounts)

Troubleshooting:
  • "Internal Server Error"- This does not necessarily mean that the server is misconfigured; in fact, it usually means that a CGI script a user has installed is not functioning correctly, and the server is detecting this. Common causes are: the file is not executable, there is a malformed header, or it is has an incorrect path reference when using a Server Side Include. Also make sure there are no control characters included in the script by using 'Ascii' mode when uploading, or by using the 'Remove Control M's' utility on the Control Panel.


  • Use of the Perl Validation tool on the control panel can reveal most common errors.


  • Many errors in Perl CGI scripts can be more easily diagnosed by adding
    use CGI::Carp qw(fatalsToBrowser);
    to the top of the program. This will cause fatal error messages your script generates to be sent to your web browser.


  • Make sure you have your path to Perl listed correctly in the script, and the HTML code of the page correctly refers to the script.


For more assistance, please call Technical Support at 954-429-3449 between the hours of 9 AM and 10 PM Eastern, or E-Mail us.