Re: CGI scripts and Busybox
On Sat, 14 Jun 2008 14:32:19 +0000
Tzafrir Cohen <tzafrir@cohens.org.il> wrote:
> On Fri, Jun 13, 2008 at 09:28:02PM +0200, Nyizsnyik Ferenc wrote:
> > On Fri, 13 Jun 2008 22:03:58 +0300
> > ccostin <ccostin.dmu@gmail.com> wrote:
> >
> > > Hello
> > >
> > > What is the minimal configuration for httpd.conf required by
> > > busybox httpd to run simple CGI scripts ?
>
> I believe that busybox in Etch does not support it yet.
>
> Generally busybox is a rather slow-moving package, due to its usage in
> the installer. Consider downloading it from source and rebuilding.
> It's a single binary.
>
> > > For this are necessary any special environment exported
> > > variables ?
> > >
> > > When I try to load simple bourne shell scripts, Iceweasel ask me
> > > to save them on disk.
> > >
> > > Command line for busybox is
> > > busybox httpd -h /var/www/
> > > and shell scripts are contained in /var/www/cgi-bin/, and have
> > > a+x execution bits.
> > >
> >
> > Sounds like a problem with the content-type. Make sure you set it to
> > text/html, like the following simple script:
> >
> > #!/usr/bin/bash
>
> /bin/bash fir a script? I figure busybox ash would be faster (and may
> even save you time on for/exec, as it's the same binary).
>
> shell scripts may be useful for trivial CGI scripts. But for anything
> more complicated they become rather slow. And I really don't trust
> them to handle input correctly.
>
> The busybox "tiny unitities" page recommends microperl and lua.
> microperl requires rebuilding perl. The result, though, is a more
> limited perl variant, but also considerbly smaller (e.g: 1MB vs. 5MB)
> and hence faster to load and requires less memory.
>
ccostin explicitly mentioned Bourne shell scripts, that's why I used
bash. Very impressive work with the benchmarks, though.
--
Nyizsa.
http://nyizsa.uni.cc
Reply to: