Create Website, Create Web Development, Web site Creation, website design India, Offshore Outsourcing India, web development company India,
web designing India web designer india, offshore web development india web site designer, flash web design india, 3d animation india, graphic design india

Login :
Name :
Password :
web animation india
A detailed overview of CGI Installation Guide
This is a complete and detailed overview of CGI installation guide helping you to make your site interactive and dynamic. Even a beginner can easily install the script to its website just by reading this simple installation manual.
Buy or get the most suitable script for your website and then just get-going!

Initially some of the questions that you wish to know before the installation begins. Here they are:
  1. What is CGI Script?
  2. Where can I get a CGI script?
  3. Where is my data stored?
  4. What kinds of scripts do I need?
  5. Selection and Evaluation of a script
  6. Getting prepared for CGI scripts
  7. Start Installation NOW
  8. Know more from Errors
  9. How can Web Animation India help you?

(I) What is CGI?

CGI is commonly named as Common Gateway Interface permits the users of a computer to run programs in a computer. It makes the web page more dynamic and is written in the following languages: C++, Perl, and even Microsoft Visual Basic). The final output of the CGI script is in the form of a HTML document.

(II) Where can I get a CGI script?

CGI script can be written by yourself, if you have knowledge in the programming field i.e. cognition in the language C and UNIX. The languages that should be known to you are: C++, Perl, and even Microsoft Visual Basic. After the noesis of the language is done, and when you have sat down to write down the script you must be well accustomed with the shell script concepts of UNIX and internal constructs of the UNIX. Now letting your CGI run, you will need an Apache server and a web server. After the required web server is installed in your machine, you must be now checking on the security terms of the script so that it doesn’t crash the system.

CGI script can also be found on the Internet, there is an abundance of the scripts over the Internet. And, some of the scripts can also be found for free by the non-profit organizations. They are available in the zip format where you can uncompress it and then use it accordingly.

(III) Where is my data stored?

Major scripts of the CGI gets stored in the flat text files i.e. ASCII files. When you are writing the script using the Perl language then it makes it very convenient to extract the files in the text files format. On the other hand, if you are using the UNIX language then it secures the file protecting it to be accessed by the users. There is an external database which you can use popularly termed as MySQL. (Run the MySQL set up in your web server before executing it).

(IV) What kinds of scripts do I need?


Let me explain this procedure with a help of an example. You have a website and you need to know the visitor’s feedback or their take on your website. For just a simple feedback form you need to install a Form Mailer script which can be followed by a text/graphic counter that displays the number of visitors to your site.

Then comes if you own a business/corporate website you need to conduct a survey then you need a Survey or Poll script. And, there if you want to shield or protect some of your pages for members only, then you can install a password protection script. If you have a e-commerce website or related with os-commerce then you need a good shopping cart script that well supports SSL.

Web Animation India has a list of CGI scripts which you can install in your websites according to the need: counter, form, discussion forum, password, web-based free e-mail, shopping cart, chat, download books or scripts, suggest your site to a friend, opinion poll, survey, quiz, database, calendar of events, add a link, free web pages, banner ads, rating, daily quote, site search, search your site and even a search engine.

(V) Selection and Evaluation of a script

It is very important to select the most appropriate script for your site and then proper evaluation should be done in order to smooth functioning of the script. Although it eats a lot of time and lots of hours and days are invested but it’s worth the time. There are various informations about the script that helps you identify whether it is good or not. They are as follows:
  • Information Available about the script
  • Demo version of the script
  • Sites that uses that particular script
  • System requirements of the script
  • Support systems attached with the script
You can hire a script writer for $25-100 or hire companies that offer scripts at a small rate. The information available on the script is sufficient then you download the script and then unzip the utilities and extract the files into your hard drive. You will also find some .asp files; they help you know whether the files are making the maximum use of the template.

You can customize the script for the look and feel of your website like some html files contain the form tag like <form action="filename.cgi" method ="GET">. This says that you can call this file in your web browser and change the look with the HTML editor. Sometimes your script might not allow this because files are mostly .cgi and .pl files which automatically adjust the appearance of the file and you don’t have much control over the look and still if you go for it then it will be entirely at your own risk.

(VI) Getting prepared for CGI scripts

The basic thing that you will need which installing the CGI script is the Telnet/ FTP program for uploading and downloading file from and to your server.
Steps to follow are:

1. Locate the Perl program in your server

you get this location from the FTP program you are using it is generally shown as follows:

# ! /usr/local/bin/perl
# ! /usr/bin/perl5

Sometimes due to variety in server the path will be shown as follows:

Which perl

2. The server path (or root directory path) to your CGI-bin directory.
A path to the CGI -bin directory from your server it may look like this:

/home/httpd/www/cgi-bin

3. URL of CGI-bin directory
you can access your cgi-bin by the following


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

4. Path of the sendmail program
it is used which is sending any information from your site to the users.

/usr/sbin/sendmail
or
/usr/lib/sendmail

(VII) Start Installation NOW Initially, open the readme file and install all the necessary files required for installation. If you are able to successfully download then it means that you were able to make all the files required for installation. Five easy steps for this are:

1. Follow the installation document and open the .cgi or .pl file in a text editor by typing the following:

# ! /usr/local/bin/path

This should be the opening line to get it right. If this results in a 500 server error then either it is placed in a wrong place or this is not the first line. Copy the path of the Perl program in your server followed by a '#!'.

2. While you are reading about the .cgi and .pl files change the cgi-bin path with the one copied in the earlier step. Then read the instructions given in the Remarks section. Sometimes there are some warnings given below of the manual you should strictly follow this in order for successful running of your cgi-script. If any change made to the warnings then it will be entirely done at your own risk. After that more script pages are asked to be opened.

What is CGI-Bin?

It is a special directory positioned in the server where we place all the files for security reasons. You must limit the access to this cgi-bin to members only because it opens up many secured information. If the cgi-bin has not been installed in your server, then ask the system administrator to do the same. A cgi-bin is needed to run these scripts unless your system administrator has turned on ExecCGI, which enables .cgi extensions to be used in any directory. Another thing you have to make sure is that you have to set all the variables so that it will reflect all the changes that you have made to the location of files and scripts by double checking.

3. Prepared for upload. Yes, now you are full prepared to upload. There are two methods in which you can upload one is a. ASCII, b. Binary

Upload the .cgi, PL, .confide, .cfg, .setup and .txt files in ASCII mode, because basically they are in text format, whereas if there are any images then upload using the Binary mode. If you fail to do this way then it will make the files unexecutable.

4. Change the permissions of the script files but for that chmod (changing mode or permission) field should be very clear to you before making any changes in the permissions of script files. File or script permissions allow you to read, write, and execute access to users based on their user identification (also known as uid or user identification), and their membership to certain groups. The following command should be used to change the permissions of the script: chmod. For instance.

chmod 755 form.cgi

What is Chmod?

Chmod is a UNIX command which changes the permissions of any particlaur script file, giving only the members to read, write and execute certain files.

Now to make your script file executable the code is 755. it is required just for once. When you FTP the file again then it will overwrite the existing file and will be automatically be replaced by the newer file. Only some of the FTP software (like WS_FTP) has a built-in option to let you change the permissions without having to telnet to the server.

Do you wish to set permissions from your FTP program? (If you wish to do so then continue reading, otherwise skip to No.5) After you chmod the file, type in ls Ls (that's Ls[space][dash]Ls) and it will show all the directory listings. In WS_FTP you can view it by pressing the Refresh and DirInfo buttons. You can also find that next to the .cgi files there is something like:

- r w x r – x r - x

Here alphabets signify the following:
"r"= read
"w"= write
"x"= execute

These three files are categorized into 3 broad categories. First set of the file are the permissions defined for the users of the file. Second set of the file signifies the permissions of the file group. Suppose you have employees working a web project together as a team then you might set up a server as a group so that edit each other's work. So by making chmod 755 with filename.cgi, you and your group of employees can work as a group where you can read, write, and execute the file.

What does 755 stands for?

These 3 digits corresponds to different sets of permissions (file owner, groups and others). Here what each individual digit stands for:

1 = - - x
2 = - w -
3 = - w x
4 = r - -
5 = r - x
6 = r w -
7 = r w x

5. Go to the browser and run the script. In the installation guide it is written which url will direct you to your script. There might be some error, a minor one for sure. You just need to check it once so that you have a perfect script running for you. That just means that something (hopefully minor) is wrong with how the script is set up. You need to double check once again from the beginning and here is a check list that can help you.
  • Check the root directory
  • Mode in which you uploaded the script
  • Permissions of the script files
  • Location of the files
  • Missing of any files
  • Changes you made

(VII) Learn From Errors

Suppose the script is well written and is absolutely error free then also there might arise some errors which browser shows. Some of the most common errors that the browser shows are as follows:

  • Server: Error 500 or Internal server error
    Error 500 is shown for many reasons some of the reasons due to which it happens are if the script does not contain the following:
  • "#!/usr/local/bin/perl" header (it represents as a Perl Interpreter )
  • first line of the script contains an invalid HTTP. For instance, "Content-type: text/html" or if a blank line is missing from the header data.
  • Syntax error. That means it is recommended that you run the script from the command-line initially.
  • Check whether the ACTION=”” command is towards the directed CGI program and also check the file is chmoded 755 so that every user can easily execute the file.
  • At the execution time, all the files should be chmoded so that the server can read them all.
  • Make sure that all the paths to commands are correct
  • Errors 403 "File Not Found"
    double check your entries of the URL so that they form a complete URL. Many people have been found having problem in this area where they do not change the URL’s from the standard deviation.
  •  Error 501 "Cannot POST to non-script area..."
    CGI script can be run in majorly two ways. Firstly, inside a cgi-bin directory. Error 501 conveys that the server do not support the POST to a non –script area. If you try to link the page to an executable program it will not allow the program to be run on the server

    Ways in which it is executed are:
    • Files present in the directory are designated by the server administrator and finally they are executed as a CGI script
    • Files having a special naming convention as.cgi are executed as CGI scripts. Some times you may need to rename PL files into .cgi to make the server understand your script type, but this is very rare.
       
  •  "File Does Not Exist"
    If the wrong path is stated then this error occurs. The path to the file should be towards the Perl. (Like " /usr/bin/perl") The path to the HTML document should also be correct.
  • Cross-Browser compatibility
    if your content-type headers are wrong, some browsers do not allow the execution of the script and hence this error occurs. Apart from this, the other cross browser compatibility is null characters in text/html or text/plain output. Correct and check that your output is strictly correct; it helps to check the script with different browsers.

(IX) How can Web Animation India help you?

After going through the manual, may be you are successfully able to install the cgi script in your server and also able to make it error-free. Sometimes, after all this your script is still not working then, Web Animation India’s experts might come to the rescue. Feel free to discuss your problem, with us and we can together make it working.

You can contact us anytime for a free quote and you can sure that you will benefited at the most.


© 2004, All Rights Reserved by Web Animation India
Powered By : Silicon Valley Infomedia Pvt Ltd