On Tue, May 30, 2006 at 03:34:00PM -0700, prad wrote: > i'm using php right now and things are fine. > however, after reading various threads on the (recommended by several people > here) MARC (http://marc.theaimsgroup.com/?l=openbsd-misc) list, i was curious > about learning some new things like: > > cgi > fastcgi > lighttpd > ruby > > which came up in the discussions. > > i tried to got a ksh script to work after i copied the ksh into /var/www/bin > my understanding is that the chrooted environment doesn't give access to > the /bin/ksh program. > > i tried the same thing with python, but kept getting > Internal Server Error on the browser > > and the following in the error_log: > No such file or directory: exec of /htdocs/z/jonpy1.cgi failed > Premature end of script headers: /htdocs/z/jonpy1.cgi > > i tried the same thing with ruby (copied both ruby and erb into /var/www/bin) > and got the same thing again. > > so is there something else i need to do to get cgi working in openbsd's > chrooted environment? > > (also, lighttpd looks really neat and clean, but i don't think it runs > chrooted by default, right? (it's .conf file is in /etc) so to get it to do > that would require understanding just what the chrooted process involves, > which i can find from the web.)
Hello prad, Of course if you run a webserver chrooted you have to care that all library and stuff a program (in that case a CGI) needs, are accessibly withing the chrooted environment. But you already got that tip. The error message you get "Premature end of script headers" means that the HTTP header generated by your CGI is not correct. You need at least to tell the webserver what content type your CGI generates before sending any further data. For example in a sh script: #!/bin/sh echo "Content-Type: text/html" echo "" echo "I'm sorry Dave, I'm afraid I can't do that." The empty echo represents a second \n which signals the end of a HTTP header. Regards, Marcus -- Marcus Glocker, [EMAIL PROTECTED], http://www.nazgul.ch -----------------