|
ru en
|
|||||||||||||||
Perl and CGI programs — specifics of usageContents
If you already possess composed CGI scripts, before copying them to server you should undertake the following actions:
Now you may copy your scripts to the server. Files should be loaded to directory your_domain/cgi. Files from this directory will be accessible at http://your_domain/cgi-bin/file_name. To enable launching of CGI scripts from the website root directory your_domain/docs, you should create .htaccess file with the following contents:
Scripts shall be assigned with execution attribute (access rights 755 or -rwxr-xr-x). Attributes can be changed through the file manager of the control panel. 2. Composing simple CGI script Let's consider composing simple CGI script on Perl. If you use Windows OS, working with scripts code requires a specialized text editor, for example, Notepad++. Windows standard Notepad program is a poor alternative. To demonstrate operation of CGI script it is required to create two files. The first file is an html document with text entry form:
The second file is a CGI script
You may place the first file in directory your_domain/docs. The second file must be placed in directory your_domain/cgi. Make sure you check the rights to your CGI script. They shall be set to -rwxr-xr-x or 755 value. 3. Viewing installed PERL modules To check installed PERL modules it is required to perform the following actions in a consistent manner:
4. Installation of additional PERL modules You may install to hosting additional PERL modules from the source codes. Before starting installation, connect the latest version of PHP in section "Web server" — "Modules management" of the hosting control panel. In this case the updated software toolkit that may include the desired Perl module will be connected. Before the installation you should set the environment variables to make the installed modules available for the interpreter.
To install the selected module for PERL, the following steps are required:
Installation should be made to a separate directory, for example, /home/login/PERL, where login — hosting identifier by specifying variable INSTALL_BASE.
To use the installed modules in perl script you should connect them by adding the following lines in script file:
To allow operation of Apache web server with the additional modules, you should in hosting control panel enable module env_module and add the following lines into file .htaccess in the website root directory or in directory with CGI scripts:
where login is hosting identifier. Error 403 If you see 403 error when addressing the script, it means incorrect access rights have been assigned to script. CGI scripts shall be assigned with execution attribute (access rights755 or -rwxr-xr-x). Attributes can be changed through the file manager of the control panel. Error 500 If you see 500 error when running your script, it means the script has an error, by which Perl translator is unable to complete its operation. Error may be both syntactic (for example, you forgot to close a quote or bracket), and logical, for example some of your actions caused a zero division operation. To understand the nature of the error, you should view web server log files stored in directory your_domain/logs. |
||||||||||||||||
Copyright © 2000-2024 Registrar R01 |
Information: info@r01.ru
Support: support@r01.ru Office: 1 Bolshoy Gnezdnikovsky Lane, building 2, Moscow (Tverskaya metro station, entrance No. 9, Voznesensky business center) |