Forum Moderators: coopster & phranque

Message Too Old, No Replies

ssi query when run on another website.

I want to do something smart

         

newangler

4:10 pm on Jul 17, 2002 (gmt 0)



Hello all my dear freinds.
I have a small problem. I want to run a central cgi script using ssi on my clients websites.

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

jatar_k

11:13 pm on Jul 17, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WmW newangler

this has trailed all day so I will give you a welcome and a bump to see if someone who knows more than me can answer. The permissions look right but I know that there are some experts that haven't answered yet so hopefully the bump will get their attention.

jatar_k

11:19 pm on Jul 17, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



still thinking,

what is the error you get or is there something specific it isn't doing?

rcjordan

11:32 pm on Jul 17, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm by no means an ssi expert, but I don't think there is any way to remotely call it. I even had trouble getting it to work across multiple domains on the same dedicated server.
[webmasterworld.com...]

bird

11:47 pm on Jul 17, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



"Exec cgi=" will only work if all domains are individually configured to use the same physical cgi-bin directory, as it can only access files below the document root. Alternatively, you could use symbolic links to make the script directly available from a number of seperate cgi-bin directories.

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.

jatar_k

12:27 am on Jul 18, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You were one of the people I had in mind bird (no offence rcjordan), interesting I didn't know that.

I have included a tracking script on client sites before but I have always used include with the url and had no problems.

bird

1:04 am on Jul 18, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Heh, all I do is read up the details in the manual [httpd.apache.org]. ;)

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" -->

and:
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.

jatar_k

1:20 am on Jul 18, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



oops, sorry

did I mention that the tracking script was included in php?

I have only used this method

<!--#include virtual="/cgi-bin/example.cgi?argument=value" -->

for this particular scenario.

Key_Master

1:31 am on Jul 18, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not sure exactly what type of script you are using, but maybe you could have an iframe on your client's site that directly calls the cgi script from your site.

newangler

3:40 am on Jul 18, 2002 (gmt 0)



thankyou all for your replies. I think what I may do is have the page that is calling the cgi script hosted on my server when they click on my clients page. Could work will let you know.