Page 1 of 1

CGI-bin and web-hosted domains

Posted: Thu Jan 03, 2013 6:01 pm
by mrpasini
According to the CGI FAQ List (https://wiki.sonic.net/wiki/CGI_FAQ_List):

"If you have a web-hosted domain name, any requests for the "cgi-bin" or "cgi" subdirectory will be directed to content in /usr/local/lib/httpd/cgi-bin/ instead of your normal web content. This is an artifact of an older web cluster configuration left in-place to support legacy web sites."

But I've found that calls to my Value Hosting site at http://[mydomain.com]/cgi-bin/test.pl return a 404 Not Found error. And calls to http://[mydomain.com]/cgi/test.pl return, "CGIwrap Error: User not found in passwd file."

What does work, however, is adding my username to the URL: http://[mydomain.com]/cgi-bin/[username]/test.pl or http://[mydomain.com]/cgi/[username]/test.pl

Re: CGI-bin and web-hosted domains

Posted: Mon Jan 07, 2013 10:10 am
by williamt
The statement is kind of confusing.
It's trying to say the location on disk where your cgi files are located not the url.
You need to add your username after cgi-bin so http://mydomain.com/cgi-bin/username/test.pl

You should probably stick to using /cgi-bin/ over /cgi/

Re: CGI-bin and web-hosted domains

Posted: Mon Jan 07, 2013 10:44 am
by mrpasini
Yes, I think the FAQ should include your note that "You need to add your username after cgi-bin so http://mydomain.com/cgi-bin/username/test.pl.

The phrase "any requests for the 'cgi-bin' or 'cgi' subdirectory will be directed to" suggested otherwise to me.