Perl not in standard path!

"Disk Station Manager 2.0 September Beta highlights a wide range of newly added business features, including RAID 6 volume type, built-in NFS, Link Aggregation, Virtual Host, as well as an extensive scope of function enhancements covering Download Station 2, File Station, Audio Station, Photo Station, Surveillance Station, and many more."
Eismaus
I'm New!
I'm New!
Posts: 6
Joined: Wed Aug 06, 2008 4:48 pm

Pearl - Who to put the cgi files?

Postby Eismaus » Tue Aug 12, 2008 10:26 pm

I have the new FW 2.0-0702.

It should integreat pearl.
Does somebody know, if there is a special path i have to put my perl cgi file, or some special settings i have to made?

Thanks Eismaus
DS-108j DSM 2.0-0722
segfault
Versed
Versed
Posts: 260
Joined: Sat Feb 09, 2008 7:26 pm

Re: Pearl - Who to put the cgi files?

Postby segfault » Wed Aug 13, 2008 12:51 am

You can change the file extension of perl cgi scripts to ".cgi" and put under any subdirectories of /usr/syno/synoman. The scripts then will run in port 5000 web server.

For running perl scripts under web station, you shall tune the settings of apache conf yourself.
User avatar
NetBoot
Ace
Ace
Posts: 725
Joined: Tue Oct 24, 2006 8:20 pm
Location: Northeastern U.S.

Perl not in standard path!

Postby NetBoot » Sat Aug 16, 2008 1:25 pm

Please move perl to where it belongs, /usr/bin and not /usr/syno/perl5/bin

Not putting binaries where there usually are just creates headaches.

If it must be there, add the path in the final release.

Thanks!

Net....

RD: Why do they do those things? :evil: :twisted:
Product Model: DS-106
Firmware Version: 2.0.3 - 0640

I have my reasons for my insanity....
deshka
Trainee
Trainee
Posts: 10
Joined: Sun Aug 24, 2008 12:37 pm

Re: Perl not in standard path!

Postby deshka » Sun Aug 24, 2008 12:39 pm

How do i enable perl on new beta FW? I created cgi-bin directory in web/cgi-bin, but as soon as i try to execute .pl file im getting the content of it.
Product Model: DS-106j
Firmware Version: 2.0 - 0702(beta)
User avatar
NetBoot
Ace
Ace
Posts: 725
Joined: Tue Oct 24, 2006 8:20 pm
Location: Northeastern U.S.

Re: Perl not in standard path!

Postby NetBoot » Sun Aug 24, 2008 1:47 pm

Add a link to it.

run

ln -s /usr/syno/perl5/bin/perl /usr/bin/perl

Net....
Product Model: DS-106
Firmware Version: 2.0.3 - 0640

I have my reasons for my insanity....
deshka
Trainee
Trainee
Posts: 10
Joined: Sun Aug 24, 2008 12:37 pm

Re: Perl not in standard path!

Postby deshka » Sun Aug 24, 2008 3:22 pm

Hi,

thx for reply. I've changed the perl path already. Here is the script. (transfered in ascii mode. Set on 755)

Code: Select all

#!/usr/syno/perl5/bin
# test.pl v6.01.18
# (c)2002-2006 Cusimano.Com Corporation, all rights reserved

$www = $ENV{'SERVER_PORT'} ne "";
eval "use Compress::Zlib"; $hasCompress = $@ ? 0 : 1;
eval "use LWP"; $hasLWP = $@ ? 0 : 1;
eval "use LWP::Simple"; $hasLWPsimple = $@ ? 0 : 1;
if ($hasLWPsimple) {
   eval "use LWP::UserAgent";
   my $ua = LWP::UserAgent->new(timeout => 30);
   $u = "http://www.c3scripts.com/test/test.txt";
   $resp = $ua->request(HTTP::Request->new('GET', $u));
   $okLWP = $resp->content =~ /test\.pl/i;
}
eval "use CGI::Carp qw(fatalsToBrowser)"; $hasCGI = $@ ? 0 : 1;
$w = 20; $f = "<b>%" . $w . "s</b> : %s\n"; $f2 = " " x $w . " & %s\n";
print "Content-type: text/html\n\n<html><body><pre>" if ($www);
printf $f, "test.pl", "v6.01.18";
printf $f, "Perl", "v$]";
printf $f, "CGI::Carp", ($hasCGI? "" : "not ") . "installed";
printf $f, "Compress::Zlib", ($hasCompress? "" : "not ") . "installed";
printf $f, "LWP", ($hasLWP? "v$LWP::VERSION " : "not ") . "installed";
printf $f, "LWP::Simple", ($hasLWPsimple? "" : "not ") . "installed";
printf $f, "LWP::Simple", "rx " . ($okLWP? "" : "not ") . "ok" if ($hasLWPsimple);
printf $f, "\@INC", $INC[0]; foreach $x (1..$#INC) { printf $f2, $INC[$x];}
foreach $x (sort keys %ENV)
  { printf $f, $x, $ENV{$x} }
print "</pre></body></html>\n" if ($www);
1;


Getting the code of the file instead of a result of it. Script is in /web/cgi-bin/test.pl folder.
I've fond LoadModule perl_module modules/mod_perl.so in httpd.conf isnt loaded at all. Is it normal?
Something is missing. I dont know what.
Product Model: DS-106j
Firmware Version: 2.0 - 0702(beta)
deshka
Trainee
Trainee
Posts: 10
Joined: Sun Aug 24, 2008 12:37 pm

Re: Pearl - Who to put the cgi files?

Postby deshka » Sun Aug 24, 2008 5:08 pm

How to tune? Ive fond thise in httpd.conf

Code: Select all

#<Directory "/usr/syno/apache/cgi-bin">
#    AllowOverride None
#    Options None
#    Order allow,deny
#    Allow from all
#</Directory>


changed to /volume1/web/cgi-bin but scripts dont run.

with "wich perl" you'll se that perl is in standart path /usr/bin/perl
Product Model: DS-106j
Firmware Version: 2.0 - 0702(beta)
dmmueller
Rookie
Rookie
Posts: 33
Joined: Fri Nov 02, 2007 6:32 am

Re: Perl not in standard path!

Postby dmmueller » Thu Sep 04, 2008 4:20 pm

One other option, if you are trying to get CGI files to work from a hosted web site on the NAS:
An .htaccess file containing Options +ExecCGI can placed in the folder of the hosted page.

This worked quite well for getting Movable Type to run from the Syno box (after adding the symbolic link for perl's path as describe above)

see http://httpd.apache.org/docs/1.3/howto/htaccess.html for more details.
DS106 - Disk Station Manager 3.1-1635
DS207+ - Disk Station Manager 3.1-1635
DS209+II - Disk Station Manager 3.2-1922

Return to “Beta Disk Station Manager 2.0-0702”

Who is online

Users browsing this forum: No registered users and 1 guest