• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

How to envoke a Perl script in /cgi-bin

S

sakshale@

Guest
Could someone point me to some documentation, other than the FAQs, on how to use perl?

My problem is simple. I want to run a perl script as my root document, to envoke the real script in /cgi-bin. I have the following script in [domain]/httpdocs/wiki.pl

#!/usr/bin/perl
package OddMuse;
$DataDir = '/wiki';
do 'current.pl' or die;


How do I specify the path to [domain]/cgi-bin/current.pl in the wrapper script?
 
Some followon information.

I had created a test.example.com subdomain, but the perl script was not even being envoked. It simply printed as text on the browser.

I discovered that in [domain]/conf/httpd.include there was the statement Options -Includes -ExecCGI

This was caused by the options CGI support and mod_perl support not being selected under the settings menu for the subdomain.

Fixing that changed my symptoms to printing a blank page, instead of nothing.

Perl now works, but the main program does not. Perl can be testing by running the following test.pl script.

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<HTML><HEAD>";
print "<TITLE>CGI Test</TITLE>";
print "</HEAD>";
print "<BODY><H2>This is a test page using Perl!</H2>";
print "</BODY></HTML>";
 
Well, I not having much luck. I've been changing the include statement to see what it takes to get it to work.

The error message I see in the log file is: [error] Died at /var/www/vhosts/[domain]/subdomains/test/httpdocs/wiki.pl line 4.\n

Line 4 is variations on: do './test.pl' or die;

The test.pl script exists in both the [subdomain]/httpdocs directory and the [subdomain]/cgi-bin directory.

I have tried: test.pl, ./test.pl, /test.pl, /cgi-bin/test.pl.

The only variation that works is: /home/httpd/vhosts/[domain]/subdomains/test/httpdocs/test.pl. Do you really need to have the physical path included? If so, what good does the cgi-bin directory provide?
 
Just a verification for completeness: [domain]/conf/httpd.include does include the following two statements;

ScriptAlias /cgi-bin/ /var/www/vhosts/[domain]/cgi-bin/
ScriptAlias /cgi-bin/ /var/www/vhosts/[domain]/subdomains/test/cgi-bin/

It seems to me that statement should allow /cgi-bin/test.pl to work.
 
Back
Top