[cs631apue] Question about CGI

Chao Cui ccui1 at stevens.edu
Wed Dec 12 10:39:09 EST 2012


It is clear now.
Thanks

2012/12/12 Jan Schaumann <jschauma at stevens.edu>

> Chao Cui <ccui1 at stevens.edu> wrote:
> > $ pwd
> > /home/jschauma
> > $ sws -c ./sws/cgi-bin ./sws
> >
> > HTTP request       absolute pathname
> > ------------------------------------------------------------------------
> > /                   /home/jschauma/sws/index.html (or directory listing)
> > /cgi-bin/foo        /home/jschauma/sws/cgi-bin/foo
> >
> > Above is a example you gave to us.
>
> Ok, let's use that as the correct definition, then. :-)  This is the way
> that most other web servers handle this, too, so let's be consistent.
>
> That is:
>
> - a client request for a CGI must begin with "/cgi-bin"
> - the remainder of the resource path given by the client is resolved
>   relative to the directory given to the server's "-c" flag
>
> Examples (in addition to the above):
>
> $ sws -c /var/www/cgi-bin /var/www/sws
>
> HTTP request       absolute pathname
> ------------------------------------------------------------------------
> /                   /var/www/sws/index.html (or directory listing)
> /cgi-bin/foo        /var/www/cgi-bin/foo
>
>
> $ pwd
> /tmp
> $ sws -c ./dir ../usr/local/htdocs
>
> HTTP request          absolute pathname
> ------------------------------------------------------------------------
> /dir                  /usr/local/htdocs/dir (or directory listing)
> /cgi-bin/dir          /tmp/dir/dir
> /cgi-bin/subdir/file  /tmp/subdir/file
>
>
> I've updated the manual page accordingly.
>
> I hope this clears up the confusion and makes things simpler.
>
> -Jan
> _______________________________________________
> cs631apue mailing list
> cs631apue at lists.stevens.edu
> https://lists.stevens.edu/cgi-bin/mailman/listinfo/cs631apue
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.stevens.edu/pipermail/cs631apue/attachments/20121212/3c63a301/attachment.html>


More information about the cs631apue mailing list