Rebuild Perl on a cPanel Server

Every now and again perl will become broken or corrupt either because of something we’ve done or, like most things, out of nowhere with now warning. Run the following:

“Rebuild Perl on a cPanel Server”Continue reading

Perl does not work because suexec denies execution

Short solution.

If you have for example:

[root@server]# suexec -V
-D AP_DOC_ROOT=”/var/www” <<<<<<<<<<<<<<<<<<<<<<<< correct place for suexec scripts -D AP_GID_MIN=100 -D AP_HTTPD_USER="apache" -D AP_LOG_EXEC="/var/log/httpd/suexec.log" -D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin" -D AP_UID_MIN=500 -D AP_USERDIR_SUFFIX="public_html" [root@server]# then: 1.) create a directory /var/www/cgi-bin (owner root / chmod 0701) 2.) create a directory /var/www/cgi-bin/YOUR_CUSTOMER (owner YOUR_CUSTOMER / chmod 0701) 3.) add symlink $HOME_of_virtualhost/cgi-bin which points to /var/www/cgi-bin/YOUR_CUSTOMER 4.) add path option which allows executing scripts (perl etc etc) in $HOME_of_virtualhost/cgi-bin CGI will work.

CGI – web status of system’s command.

#!/usr/bin/perl

use strict;
use warnings;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);

#print header(-type=>'text/plain');
print header( -charset => 'utf-8', -refresh => '10' );
print start_html();

my $info1 = `cat /proc/mdstat`;

print "...html";

print end_html();
Scroll to top