I'm new to FreeBSD - I'm coming from Linux (various versions). I run a local apache server - it's only on the LAN. I haven't configured any jails yet. I use perl and mysql with apache. I've written some generic routines in perl and put them in a file (.pl) that gets included from other perl files. A simple test example would be something like this. In fact this is what I've been running to test that everything works.
first.pl:
The file hello.pl looks like this:
Both files are in the cgi-bin directory.
The permissions on the cgi-bin directory are:
And the file permissions are:
When I load first.pl with apache it executes everything up to the "do" statement. The error message I get is "No such file or directory".
I can execute first.pl from the command shell and everything works. This code was running under KDE before I migrated to FreeBSD.
The configuration in httpd.conf for the cgi-bin directory is as follows:
What am I missing? Is there a configuration option in httpd.conf that I need to set that allows one perl script to execute another perl script? I'm pretty much using the same httpd.conf options that were working under KDE. I'm guessing there is a security feature that is preventing apache from loading the second perl script.
first.pl:
Perl:
#!/usr/local/bin/perl -w
print "Content-type: text/html\n\n";
print "<HTML>";
print "<HEAD><TITLE>First</TITLE>";
print "<Body>";
print "First file -calling routine \n";
do "./hello.pl" || print "Fatal Error: $@ Can't load hello.pl $!";
print "</body>";
print "</html>";
The file hello.pl looks like this:
Perl:
#!/usr/local/bin/perl -w
print "Hello, World.";
Both files are in the cgi-bin directory.
The permissions on the cgi-bin directory are:
Code:
drwxrwxrwx 6 www www 1024 Jan 18 14:27 cgi-bin
Code:
-r-xr-xrwx 1 www www 82 Jan 13 10:57 first.pl
-r-xr-xrwx 1 www www 424 Jan 18 14:27 hello.pl
I can execute first.pl from the command shell and everything works. This code was running under KDE before I migrated to FreeBSD.
The configuration in httpd.conf for the cgi-bin directory is as follows:
Code:
<Directory /.../.../.../cgi-bin>
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
SetHandler perl-script
Options ExecCGI FollowSymLinks
AddHandler cgi-script .cgi .pl
</Directory>