22 нояб. 2014 г. 12:54 пользователь "Riley Baird" <
bm-2cvqnduybau5do2dfjtrn7zbaj246s4...@bitmessage.ch> написал:
>
> Hi,
>
> I am running OpenBSD 5.6-stable (without the X packages).
>
> I have successfully setup the httpd(8) webserver, but only for static
> webpages. I have been unable to get cgi (perl) scripts to run.
>
> Due to the OpenBSD chroot, I have copied the folowing files into
> /var/www. The libraries were generated from `ldd /usr/bin/perl`.
> /usr/bin/perl
> /usr/lib/libc.so.77.0
> /usr/lib/libm.so.9.0
> /usr/lib/libperl.so.15.0
> /usr/lib/libpthread.so.18.0
> /usr/lib/libutil.so.12.1
> /usr/libexec/ls.so
>
> My httpd.conf is:
>
> # $OpenBSD: httpd.conf,v 1.10 2014/08/06 20:29:54 reyk Exp $
>
> #
> # Macros
> #
> ext_addr="egress"
>
> server "default" {
>         listen on $ext_addr port 80
>
>         location "/cgi-bin/*" {
>                 fastcgi
>
>                 # The /cgi-bin directory is outside of the document root
>                 root "/"
>         }
> }
>
> Using a web browser on another computer,
> http://192.168.1.55/cgi-bin/script.pl simply says "500 Internal Server
> Error".
>
> A script as simple as the below brings up this error, but it has been
> tested with other scripts:
>
> #!/usr/bin/perl
> print "Hello!"
>
> Thanks for reading,

Crazy idea just out of head:

1. Put /bin/sh and /usr/bin/kdump (both are statically linked) inside
chroot. Rename them if you feel unsafe.
2. Write a shell script that runs 'exec ktrace -if ... perl ... "$@"'. Make
sure ktrace will be able to write its output file, it will be run as CGI
user!
3. Make this script handle a connection in your web server/FastCGI config.
4. Run kdump on resulting ktrace output file and investigate problems.

If you won't get ktrace output, you'll likely have problem with FastCGI
itself, look at its logs then.

--
Vadim Zhukov

Reply via email to