Here is wat I want to do:
I want to have the cgi script in my cgi bin, but I want it called up from my clients website. But I get an error about not having permission. I have it cmod 755 and it works fine when I run it on my own site, but does not work when i call it from my clients website.
I have it set for exec cgi= and I have the full url to my script. Can anyone give me any suggestions?
Holding my breath.
Steve - Aussie Web developer
If you want a script to reside outside of the document root, then you need to use "exec cmd=", which calls it as a normal program through /bin/sh.
For obvious reasons, SSI has no concept of full URLs like "http://www.example.com/cgi-bin/some.cgi", as it looks at the files from the servers perspective. Only the "/cgi-bin/some.cgi" part has any useful meaning in this context.
I can't exclude the possibility that mod_include simply ignores everything that looks like the domain part of a full URL, but I didn't spot any mention of that in the documentation. Even then that could only work within one domain, as the module doesn't have the slightest idea where the files for another domain could possibly be stored.
Btw: I just found this paragraph, which might be of general interest in this context:
The include virtual element should be used in preference to #exec cgi. In particular, if you need to pass additional arguments to a CGI program, using the query string, this cannot be done with exec cgi, but can be done with include virtual, as shown here:
<!--#include virtual="/cgi-bin/example.cgi?argument=value" -->
The use of #include virtual is almost always prefered to using either #exec cgi or #exec cmd. The former (#include virtual) uses the standard Apache sub-request mechanism to include files or scripts. It is much better tested and maintained.