Skip to main content
Welcome guest. | Register | Login | Post

Perl CGI scripts fail on lighttpd chroot

1 reply [Last post]
Offline
Joined: 2006-01-31

Hey. I'm trying to run Perl CGI scripts - namely CGI:IRC - on my webserver. I'm using lighttpd in a chroot environment for security reasons, so the scripts, which are located within the chroot, cannot execute the Perl binary which is outside of the chroot.

To solve this, I copied the Perl binary, all the libraries that showed up in `ldd /usr/bin/perl', and everything in /usr/local/lib/perl5/ to the webserver chroot. Now the irc.cgi script executes when run in a browser, but I get errors. Here is the entry from my lighttpd error log:

BEGIN failed--compilation aborted at /data/cgi-bin/irc.cgi line 23.
Use of uninitialized value in concatenation (.) or string at interfaces/default.pm line 148.
Use of uninitialized value in bitwise and (&) at modules/parse.pl line 57.
Use of uninitialized value in bitwise and (&) at modules/parse.pl line 57.
Use of uninitialized value in bitwise and (&) at modules/parse.pl line 57.
Use of uninitialized value in bitwise and (&) at modules/parse.pl line 57.
Use of uninitialized value in bitwise and (&) at modules/parse.pl line 57.
Subroutine AF_INET6 redefined at (eval 4) line 1.
Use of uninitialized value in bitwise and (&) at modules/parse.pl line 57.
Use of uninitialized value in bitwise and (&) at modules/parse.pl line 57.
Use of uninitialized value in bitwise and (&) at modules/parse.pl line 57.
Use of uninitialized value in length at /data/cgi-bin/nph-irc.cgi line 333.
Use of uninitialized value in string eq at ./interfaces/mozilla.pm line 211.
Use of uninitialized value in substitution (s///) at ./interfaces/mozilla.pm line 221.
Use of uninitialized value in exists at ./interfaces/mozilla.pm line 222.
Use of uninitialized value in exists at ./interfaces/mozilla.pm line 223.
Use of uninitialized value in exists at ./interfaces/mozilla.pm line 224.
[Sun Jan 29 08:49:56 2006] CGI:IRC Error: Mkdir error: No such file or directory (main::load_socket 1175)

I am using FreeBSD 6.0-RELEASE-p4 on i386 with Perl 5.8.7, lighttpd 1.4.9 and CGI:IRC 0.5.7.

Any help getting these Perl CGI scripts to work would be greatly appreciated.

Offline
Joined: 2006-01-31

Well, I just decided to run lighttpd outside of a chroot, even though that's not as secure. Perl CGI scripts suck.

Comment viewing options

Select your preferred way to dis