Forum Moderators: phranque

Message Too Old, No Replies

Apache CGI & SSI

include does not work using cgi

         

rtmd

10:11 am on Nov 29, 2007 (gmt 0)

10+ Year Member



Hi all,

I want a standard header in all my layouts, so I use:
<!--#include file="myheader.htm"-->

When I load mylayout into my browser, the file myheader.htm is copied into mylayout. This works fine (so I guess my apache config settings are correct).

When I start a cgi script in my browser httpd://hp9000/testscript:
#!/bin/sh
echo Content-type: text/html
/mydir/myprog

then myprog displays mylayout. The include in mylayout doesn’t work. When I load mylayout directly in my browser (httpd://hp9000/mylayout.htm), the include works fine.

The difference is when I “get” mylayout the include is recognized and when I “put” mylayout (display inside a program called by a cgi script), the include is not recognized.

Anyone have any idea why the include doesn’t work when using a cgi script?
Thank you in advance for any help.
Rob

HP Unix 11i
Apache 1.3.19
Mozilla Firefox 2.0.0.10
Microfocus Server Express Cobol

phranque

12:35 pm on Nov 29, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld [webmasterworld.com], rtmd!

you need apache 2.0 or higher and you can use the apache mod_include module [httpd.apache.org] to set up an output filter for SSI.

rtmd

1:03 pm on Nov 29, 2007 (gmt 0)

10+ Year Member



Thank you! I will get into it.

jdMorgan

1:11 pm on Nov 29, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> you need apache 2.0 or higher...

Am I missing something in the details here? SSI works fine on my servers, and most of them are Apache 1.3x

Generally, adding


Options +Includes +ExecCGI
AddHandler server-parsed .htm

to .htaccess would suffice to get this working.

Jim

phranque

1:33 pm on Nov 29, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



i could be wrong, or maybe you missed the cgi aspect of the question.

here is apache's view as of 1.3:
[httpd.apache.org...]

and under the "Filtering" header, they are clear about new features:
[httpd.apache.org...]

maybe 1.3 was "fixed" after the faq was written and after 2.0 was released, but that seems like a mighty change...

jdMorgan

1:39 pm on Nov 29, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ah... No, I was confused as to what was included inside what in the OP.

Jim