• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

perl problems when migrating to plesk

jola

Basic Pleskian
I am migrating a large site to plesk. Most of my perl scripts are not working under plesk. I have tried to debug this and have noticed several problems, here is an example:

A have written a test file called bar.pl that contains:

Code:
#!/usr/bin/perl
print("Content-type: text/plain\n");
print("\n");
print("hello world\n");

Accessing this file via http displays "hello world" in my browser, as it should

If have also written a second file foo.pl that contains:

Code:
#!/usr/bin/perl
require "/var/www/vhosts/website.com/httpdocs/bar.pl";

In theory this file should just include the bar.pl file which should display "hello world". However, accessing foo.pl via http only works intermittently. Sometimes it shows "hello world", but most of the time it will not display anything. I have discovered that if I restart apache (/etc/init.d/httpd restart) foo.pl will always work. Hence, this problems seems to somehow be related to cache problems or something.

Anyone have any clues about what this can be related to? Perl under plesk does not seem to work in the same way as perl worked under my previous hosting environment.

I am running this on Plesk 8 since we are using the Migration Manager available in 8. Once I've got the Migration finished we will upgrade to Plesk 10 before we launch the site under plesk.
 
Replying to myself here. I have noticed that these perl problems only seems to affect my IP number based site. On a name-based site the example I showed works as expected. I'm confused.
 
Replying to myself again here. My example with the foo.pl and bar.pl files above cause problems when they are located in the httpdocs directory with Options +ExecCGI set in .htaccess. If I instead place the files in the plesk cgi-bin directory the scripts work as expexted. Hence, something must be different in how CGI/Perl scripts are run in the plesk cgi-bin directory and the httpdocs directory. Perhaps I need to add something more in my .htaccess file... anyone have any suggestions? The bug quest goes on....
 
I'm still investigating possible causes for these problems. I have noticed that when I run scripts in the plesk cgi-bin directory the suexec_log shows my ftp/ssh user being set as user. However, when I run scripts in my httpdocs directory this does not seem to happen. I assume the scripts are run as the httpd user (apache) then. Is this the normal way plesk should work?
 
Back
Top