CGI and PERL – Now introduce CGI scripts in your website.
Some information is always necessary about your server before any scripts are being set-up by you. This can be easily achieved by mailing your web hosting provider, its good if you have these on your hands before you proceed to set up a script. All the information is not needed for each of the scripts. But yes, some of the larger scripts do demand more information to work on.
Some of the information that one will require is:
- Path to Perl.
- Relative path.
- HTML path to your server.
- SMTP server address.
- Send mail path.
Path to Perl is normally the most important line at the top of a “.cgi" or “.pl" (Perl) script. Sample that is used for path to Perl is /usr/bin/perl. If the script is not able to run than the work possibly will be this variable. This is the relative path to your server, not the html path. A sample is: home/your login/public_html/.
HTML path to your server is url path to your server. For example:
http://yourdomain.com.
Send mail path is relative path to your server. For example: /usr/sbin/sendmail.
SMTP server address is the path to send mail on your server and a sample for the same is: smtp.yourdomain.com (this is hardly used some time). You can setup any of the script available, but for the same you should have the variables available at least once.
You have to open the script as it is instructed in the “installation" file or the “readme" file. By following these instructions you will get to know about which script needs to be setup with these variables and than open this file in text editor or HTML editor. Instructions available should present you the exact position to know, where all variables are supposed to be distorted or inputted. Your script should be uploaded, once your all the variables are set and than they should be uploaded ASCII, it should not be binary if you are given a choice. Your scripts need to have permission set in order to work, once you upload your scripts. You should be allowed by your FTP program to do that somewhere during the program.
Click on “FTP Commands" then on “site" than type the name “chmod 755 ……….." , by giving a right click to set the permission. Now this is the last stage, where testing of the script is done. You would be told by the instruction about how to access the script. If u get internet server error than there are surely some blunder made by you before, so to correct the same you will have to check all the things and try to upload the script again.