Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions
Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions
Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions
Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions
  Email
  Traffic
  Complete Sites
  AffiliateWare
  SearchEngine
  Site Goodies
  Featured
  Utilities
  Advertising
  Database
  MLM
  Commerce
  File Manipulation


CGI Script Configuration and Installation Tutorial.


The first part of any configuration of a Perl script is to determine certain properties of your webserver. This isn't difficult to accomplish if you know how. The easiest way to do this is to use our helper.cgi script (you can use your FTP software to upload our helper script to your cgi-bin, change it's permission to 755 and point your browser to the URL of the script, it will then show you all the info you could need) but we will go over other methods in this tutorial.

The most common information you need to configure cgi scripts is:
The path to your servers Perl Interpreter.
The full path to the directory where you will place the CGI files (usually called "cgi-bin").
The URL to where your scripts will be located.


The Path to Your Perl Interpreter

The first thing you need to configure a Perl script is to find the location of the Perl interpreter on your server. This is the software on your hosts computer that will be able to process the code that is written in the script files. You can find this information in several ways:

1. You host may have this information readily available to you on their site, in their members area or in a control panel environment. You may want to log into your hosts site and take a look around for their server settings.

2. By using a SSH/telnet client such as Putty which is you can download for free here. Once you have your telnet application installed and you have successfully logged into your webserver with it, you would issue the following command to locate Perl:

whereis perl

This command will show you output with the path to perl on your webserver. Generally it will be one of these:
#!/usr/local/bin/perl
or
#!/usr/sbin/perl

The Full Server Path to Your CGI-BIN Directory

The next thing you need to determine is the server path to your cgi-bin directory. The cgi-bin is a special directory on the server where are allowed to run small programs, usually called scripts. Most webservers only allow scripts inside of a cgi-bin to be executed. If the cgi-bin has not been enabled on your server, or if you don't have one, ask your system administrator to allow you to run CGI scripts on your server.
There are also several ways of determining the full path to your cgi-bin. In addition to using our helper.cgi script, you can also telnet into your webserver and type the command: "pwd".

This will output the complete server path to whatever directory you are currently in. A full server path might look something like this:

/home/user/public_html/

Now, to find the full path to the cgi-bin directory, you can either navigate to the cgi-bin directory using the same commands as you would in DOS or, if you aren't familiar with DOS, you can just figure that for the most part, everything in the directory public_html is accessible via the web in one way or another. In 90% of cases the cgi-bin is located in the highest level possible in public_html, making the full path something like:

/home/user/public_html/cgi-bin

If you do not want to use telnet then your FTP client may show the real path in its status bar. If not then you might be able to find the information in the members area/ control panel of your host (if they have one) and you can always ask your server administrator what the full path is.

Next we will want the actual URL of the cgi-bin directory. Generally this would be something like:

"http://www.yourdomain.com/cgi-bin"

This can usually be determined easily enough when using your FTP client. In some cases it is something much different and you may need to ask your server administrator what the exact URL is if you are unsure.

The Path to SendMail

The final thing that almost all scripts require is the server path of the sendmail program. This is used by CGI programs to send predefined output to you or others via email. You can get the exact locations on your server via telnet by typing the following command:

whereis sendmail

The following is a general idea of what it could be:

/usr/sbin/sendmail

Once you are equipped with these important variables you are ready to begin the actual configuration of your CGI script.

Editing the Script Varribles

To begin, open the README or install file in a text editor (either notepad or an html/perl editing program) and read the instructions carefully. Follow the installation instructions to the letter! On most occasions, there will be one file in the script documents that will contain the variables that you need to change. This file is often called configs.pm or configs.cgi.

You may also be asked to change settings in the code of various .cgi or .pl files in your text editor. At the top of these types of files you will find the path to the Perl interpreter. If this line reflects a different path then what you determined yours to be earlier then you need to change it, keeping the #! intact (#!/usr/bin/perl). This path will have to be correct in all .cgi and .pl files of the script you are installing for it to work properly. The readme or installation file will instruct you to edit certain variables in the code with the information you gathered in the steps above.

Follow any Comments that are in the script. (Comments are lines of code that don't do anything when the script is executed, they are just there to provide notes on what does what within the script. In Perl, all the lines which start with # are comment statements).

Uploading the Files

The next step you need to take is to upload all the script's files to your server so that they can be "seen" live on the internet. You can use any FTP program to upload files to your webserver. One of the better FTP programs out is CuteFTP. CuteFTP is popular because of it's great features and simple, easy to use interface. You can purchase it at their website. As an alternative to spending money on an FTP program, you can download a program called AceFTP for free. AceFTP has almost all of the features that CuteFTP has and a similar interface. Download AceFTP here. Since this is a cgi installation tutorial and not a tutorial for configuring FTP software, we will move on.

There are two basic ways to upload files in an FTP client, ASCII and Binary. You need to upload text files (any file that isn't an image) in ASCII mode and upload all image files like .jpg or .gif in Binary mode. If you upload script files and text files in Binary mode it can corrupt them and render them inoperable (this is a very common mistake). If you accidentally upload script or text files in Binary, simply delete them on the server and re-upload them in ASCII mode.

Next, you will need to set all file permissions for your script and associated files. This can be done which most FTP clients. As a general rule, all .pl, .cgi or .pm files should be set to permission 755. The script's installation/readme file should tell you exactly what to set the different files/directories permissions to.

Now we will attempt to run the script. The installation help file should tell you which URL you need to open that will cause the software to do what it is supposed to do or to access the admin section of the script. It could be a .cgi, .pl or a .html file. Open your web browser and enter that URL and see what happens. Don't worry if you get an error. This just means that something, usually minor, is wrong with how the script is set up. What you need to do is double check everything from the beginning and, if possible, look at your error logs if your system administrator provided you with access to them. Much of the time the error log can tell you exactly what is wrong with your installation. When your dealing with a quality script, 99% of the time you will get an error because you made a mistake when you were editing the variables in the script.

Common Errors and what they might mean

Error 500 or Internal server error.
The most common error you'll run across, can occur for many reasons:

  1. The script does not have the correct "#!/usr/bin/perl" line that points to the Perl interpreter.


  2. The first line output from the script is not a valid HTTP header (i.e. "Content-type: text/html"), or there is no blank line after the header data (\n\n generally).


  3. There is a syntax error in your script. Always run it from the command-line first via telnet to see any errors in
  4. If your script is related to a form, check to make sure that the ACTION="" tag of the form in the script or HTML is pointing to the correct CGI program. If it is, make sure that this file is also chmod 755 so that everyone, including the Web Server has permission to execute it.


  5. Check to make sure the file permissions are correct!!!


  6. Check all paths to make sure that the code is finding the location of the files that it needs to.


Error 403 "File Not Found"
Generally this is from a configuration error in which a path or url for a file is incorrect. Check all paths you have set in the cgi script configuration. Possibly this can be from a missing directory also, which the script may need to write to or read from.

Error 501 "Cannot POST to non-script area..."
The form ACTION="" tag is installed or is pointing to a location that the webserver does not recognize as a cgi-bin location. Make sure your files are located in the cgi-bin directory of your server or contact your server administrators and ask them where the script should be installed.

Error 404 "File Does Not Exist"
This error is generally caused by a request for a document that isn't at the location specified. This could mean that the URLs/path to your templates, html files or script files is incorrect. Also, if applicable, make sure that the path pointing to your script in your HTML document is correct.

This should help you with most configuration, installation issues you may have. For a very small fee, we will be happy to attempt to install non-KineticScript CGI and PHP solutions on your server for you. If we determine quickly that there's something wrong with the code we can either try to fix it or refund your money (as long as we didn't spend too much time trying to get someone's convoluted programming to work) Just use the contact button to send us your request.

©2003 KineticScripts.com Home | Scripts | Specials | Members | Demos | Purchase | Contact Us | Help | Forum
Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions Excellent Perl and PHP Script Solutions
Terms of Use  Privacy