[cs631apue] question about cgi path

Jan Schaumann jschauma at stevens.edu
Sun Nov 24 17:35:49 EST 2013


hao wu <hwu9 at stevens.edu> wrote:
> In the sws manual, it mentioned:
> "If a URI begins with the string "/cgi-bin", and the -c flag was specified,
> then the remainder of the resource  path will be resolved relative to the
> directory specified using this flag."
> 
> suppose I start the sws using:
> ./sws -c ~/www2 www
> 
> and there comes a request:
> GET /cgi-bin/a.pl HTTP/1.1
> 
> the real path of a.pl should be ~/www2/a.pl or ~/www2/cgi-bin/a.pl ?

The former (~/www2/a.pl).

"/cgi-bin" is translated to be the directory specified via the '-c'
flag.

-Jan


More information about the cs631apue mailing list