• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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