• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

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