[prev in list] [next in list] [prev in thread] [next in thread]
List: tux-list
Subject: Re: CGI
From: Marcus Gruendler <runner () tamalin ! de>
Date: 2001-04-08 21:48:54
[Download RAW message or body]
On Sunday 08 April 2001 22:41, you wrote:
> Ingo Molnar wrote:
> > On Sun, 8 Apr 2001, Marcus Gruendler wrote:
> > > In recent TUX versions, TUX starts modules and CGI programs in a
> > > chroot environment (see: man 2 chroot). The new root directory is
> > > mapped to your $DOCROOT, which defaults to /var/www/html.
>
> I am using just a shell script. I have also tried executables which
> have been statically linked. I also have the libs in my /var/www/html.
> None of them works.
[...]
>
> Now I get the following when I access http://localhost/cgi-bin.cgi
> "The document contained no data ..."
[...]
> The test-cgi is a simple script:
> [root@server1 html]# cat cgi-bin/test-cgi.cgi
> #!/bin/sh
>
[...]
Mohammad,
Do you have a copy of the shell (sh) in /var/www/html/bin ? If not, just make
one. Since your script needs to be executed with /bin/sh and your new root is
/var/www/html you need a bin directory and a shell in this directory. The
directory structure of your libraries in your new chroot environment has to
be the same as in your "normal" system, but just underneath /var/www/html.
As I have not used CGI scripts with TUX I don't know if there is a bug in
current TUX versions, but I am using TUX modules which are chroot'ed as well
and everything works fine with them if I make a copy of essential directories
from / to /var/www/html.
You can check whether your script works in a chroot environment by doing the
following:
1. open an xterm (or another console)
2. create the directory /var/www/html/bin
3. copy /bin/sh, /bin/ls and /bin/cp into this directory
4. copy your script to some location underneath /var/www/html
5. issue the command: chroot /var/www/html
6. execute your script
And read the man pages about chroot ;-)
Bye, Marcus
--
Marcus Gruendler
eMail: runner@tamalin.de
WWW: http://www.tamalin.de/runner/index_en.html
_______________________________________________
tux-list mailing list
tux-list@redhat.com
https://listman.redhat.com/mailman/listinfo/tux-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic