Adjustment, installation CGI of a script

To adjust a script for job on your site, it is necessary to have some specification first of all.

Editing skripta


To adjust a script for job on your site, it is necessary to have some specification first of all. You can learn{find out} them from your provider or if you use the public server - in the technical information of this server:


Full way to program Perl on the server. This parameter is inserted into the first line of each script. The following are usually used:

*! usr/bin/perl

*! usr/local/bin/perl (without blanks)



Full way to files of your pages on the server. You can see also this way in line "Location" yours FTP the client. For page which you read an example:

/home/dwebru/dweb.ru/www/rass/perl/003.htm



Full way to a mailer of the server. This parameter though and not the basic, but without him  cannot send a script E-Mail. An example for this server:

/usr/sbin/sendmail



Having these data it is possible to start editing scripts.


First open all files of a script in the editor (any text editor, for example in "notebook"). Then find a file with the instruction on adjustment. It can be file Readme or Setup, or the instruction is directly in one of .pl .cgi files. In the instruction it is specified what files editing demand and what parameters need to be changed. Even if necessity of editing of any files is not specified in the instruction, all the same open and check up them at least on presence or absence of the first line with the instruction{indication} of a way to Perl. All taki offered{suggested} scripts are FREE-OF-CHARGE, and in the beginning of each script the author warns, that does not bear{carry} the responsibility for his  serviceability, therefore there are cases when the author overlooks to specify necessity of editing of any file.


Then establish correct values of the parameters specified in the instruction: a full way to the specified files, URL the specified files, a way to a mailer, etc. If you specify a way to the catalogue pay attention to presence or absence of a sign "/" at the end of a way - be guided by the resulted example of the author of the program. Necessarily check up attentively all files on necessity of change of parameters. In HTML files it is usually necessary to correct only URL a script.


Except for installation of key parameters, most soon it will be necessary for you to change other parameters concerning to a configuration of a script, for example yours E-Mail, the address of the basic page of a site, quantity{amount} of recordings in a database, etc.

Installation skripta on the server


With help FTP of the client pump over files of a script on the server. Thus create necessary directories. What are necessary for creating, and what files in what directory should be it is possible to read in the instruction. Kogda you unpack just the downloaded archive with a script, the arrangement of files has most soon the same structure which should be and on the server.


Usually scripts with all directories zakachivajutsja in a folder under name CGI-BIN. If in your root there is no such folder necessarily create her , and establish parameter CHMOD=755. Installation of parameter CHMOD should be stipulated by your FTP-client.


Now it is necessary to establish necessary CHMOD for each file of a script on the server. Parameters CHMOD for files are specified in the instruction. Thus it is necessary to pay attention, that correct CHMOD it is necessary to establish and for the directories created by you. If their parameter is not specified in the instruction, it is most soon supposed CHMOD=755. The same parameter usually have .pl and .cgi files. On installation CHMOD of other files strictly follow the instruction.


Wrong parameter CHMOD for a file will lead to nerabotosposobnosti a script.

Debugging of a script


When all parameters are established also a script is established on the server, it is necessary to check up his  serviceability. How to start job of a script you will find in the instruction if it is not clear. If all parameters are established correctly, the script works at once. Thus check up all functions of job of a script what only are possible{probable}.


If the server shows a mistake at performance of a script check up still all established parameters. Check up correctness of all addresses, probably a script cannot find out any file, check up grammar of the established parameters (having compared with author's), installation CHMOD. If you changed a configuration of a script and entered what or the text pay attention that for example before signs and " it is necessary to put (if about the opposite the author has not specified).