Perl on Centos 5

Support for webhosts that use CentOS
Post Reply
daleangusbain
Posts: 2
Joined: 2012/10/24 12:42:37

Perl on Centos 5

Post by daleangusbain » 2012/10/24 12:57:13

Hey

I am a total noob with CentOS

I have manages to get Apache, PHP and well I though Perl

But when I go to a page that has been written in Perl all I see is the Perl code

[code]
#!/usr/bin/perl
use strict;
use BSD::Resource;
setrlimit(RLIMIT_AS, 128000000, 1280000000);
setrlimit(RLIMIT_CPU, 120, 120);
use CGI;
use Cwd 'getcwd';
use IO::Handle;
STDOUT->autoflush(1);
my $cwd=getcwd();
my $root_path;
if($cwd=~m#^(/home/(?:sites|cluster-sites/\d+)/[\w\.\-]+/)#) {
$root_path=$1;
} else {
die
}

$0 = "awstats";

my $cgi=new CGI;
%ENV=(PATH=>'/bin:/usr/bin:/usr/local/bin', HTTP_HOST=>$ENV{HTTP_HOST});

$|=1;

print $cgi->header("text/html");
print "<html><head><title>AWStats</title></head><body>";
print "<p>Generating stats for the first time. Please wait, this can take a while.</p><p>";

my $pid=fork();
die unless defined $pid;

if(!$pid) {
# child
open(STDOUT, ">&STDERR");
exec("./awstats.pl","-config=pharmacy4meds.co.uk", "-update");
exit 1;
}
use POSIX ":sys_wait_h";
my $i = 0;
while(waitpid(-1, WNOHANG) <= 0) {
$i++;
print ".";
if($i % 100 == 0) {
print "<br/>\n";
}
sleep 1;
}
print "</p><p>Complete. You will be redirected to <a href='awstats.pl'>the stats page</a> in a moment.</p>";
print "<script type='text/javascript'>function onward() {location.href='awstats.pl'} setTimeout(onward, 3000)</script>";
print "</body></html>";
[/code]
All of the installs that I have done are strait out of the box, and I haven’t changed anything

Any help?

User avatar
TrevorH
Forum Moderator
Posts: 23653
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Perl on Centos 5

Post by TrevorH » 2012/10/24 14:48:28

`yum install mod_perl` perhaps? Followed by a `service httpd restart`

daleangusbain
Posts: 2
Joined: 2012/10/24 12:42:37

Re: Perl on Centos 5

Post by daleangusbain » 2012/10/25 07:15:06

I tried that yesterday

Installed mod_perl and restarted the service still the same

yarnik
Posts: 29
Joined: 2014/04/08 08:26:21
Location: Ukraine

Re: Perl on Centos 5

Post by yarnik » 2015/02/25 06:36:31

Cmod 755 ?

User avatar
TrevorH
Forum Moderator
Posts: 23653
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Perl on Centos 5

Post by TrevorH » 2015/02/25 08:55:28

What is your file called that you are serving? Where is it located?
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply