View Full Version : CGI-output and SSI
I have a cgi-script that produces html-pages which contain some SSI-commands. I have used similar scripts in other servers where they have worked. However, Futurequests server parses only files ending with .shtml, and not the html that comes as an output of a cgi-script.
Is there any way to make the server to parse also cgi-output, or do I have to find some other way to get the output I want?
That's a good question. According to Apache docs, it is not possible to have server parsed output from a cgi script. However, I too have been on a server that did it (Hypermart), but they won't tell their secret about how they did it... I'm really not sure if Terra has set stuff up this way or not.
Since that didn't answer your question, I can offer only a suggestion that probably won't work anyway. Instead of having the script print "Content-type: text/html\n\n", try using "Content-type: text/x-server-parsed-html\n\n" No promises as to whether or not that will work at all though.
Sorry I can't be of more assistance.
Del
I already tried to change content-type to x-server-parsed-html, but as you guessed, it didn't work. I also tried to change it to x-server-parsed-html3, as some document somewhere suggested, but it produced funny results - my browser started RealPlayer, which started to search for some plugin.. http://www.aota.net/ubb//wink.gif
Thank you anyway for your answer. I guess I'll just have to find some other way to create the output that I want.
Lari
Terra
11-25-1998, 07:06 PM
Hmmm, Interesting proposition... I know how to do it externally, but not internally to the Apache engine...
CGI --> /www/tmp/343893.shtml (write random file)
___|--> redirect -> /www/tmp/343893.shtml --|
_________________________client browser <--|
This is what I used on the Apache 1.2.x series of servers...
I see 3 options internally
1) internal mod_rewrite with it's output piped and restacked for the SSI handling module
2) internal CGI --> SSI handler (somehow connect/bridge the 2 together)
3) mod_perl should allow me to hook the CGI API and SSI handlers forming a pipelined bridge... (variation of #2)
CGI --> mod_perl API hooks --> SSI (with traps to stop looping)
These are all speculative, and would take me some time to figure out the correct 'voodoo' necessary to do such a thing...
Del, the 'content-type' *may* also work as well, if they have changed the dynamic handling (1.2.x --> 1.3.x)... It just seems *too* easy... :p Haven't had time to test it though -- got my hands full with the new server... http://www.aota.net/ubb//wink.gif
--
Andrew Gillespie
Engine Designer/Tuner
FutureQuest.net
(In other words: I need to research this...) http://www.aota.net/ubb//wink.gif
[This message has been edited by ccTech (edited 11-25-98).]
Hypermart seems very closed-minded about sharing their secret of how they pulled it off. There have been many people tried to get the answer from them with no success. HM also parses every html document served, that's how they run their banner system. I'm sure that's part of their trick in getting ssi to work in dynamic output.
I'm still trying to get SSI to work at all on my local server (apache 1.3.? for win32). So far all I get is the [--an error occurred--] thing, which doesn't help any. I've still got tons to learn about the internal workings of Apache, so I'm of very little help in these matters. Even if I do figure anything out, it's on the Win32 system, and prolly won't apply to the real Apache I bet...
Have fun with the new box http://www.aota.net/ubb//smile.gif I take it your part finally showed up? I saw Deb's post that it should have arrived this morning.
Del
Yes, the part came in and he's off putting all the pieces together http://www.aota.net/ubb//smile.gif
Plan on downtime tonight for a GREAT REASON!!!
as for the everything concerning SSI/CGI I will keep my mouth shut and await Terra's research and what you guys come up with..it's not my specialty eheh
Deb
Gruvy http://www.aota.net/ubb//smile.gif
Del
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.