Re: Question about Server Side Includes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you both for your replies.

A little more scrutiny revealed an even simpler solution:

After generating the file with the embedded SSI directives,
I found out that as long as the file had the .shtml suffix
then the embedded SSI directives are picked up and parsed.
That worked with both <!--#include file=... and
<!--#include virtual=...

I did not have to make any other
changes in the web server config.

Thanks

Freddy


========== Begin included message ==========

>From: André Warnier <aw@xxxxxxxxxx>
>Date: Tue Jul 28 2009 11:18am
>To:   "users@xxxxxxxxxxxxxxxx" <users@xxxxxxxxxxxxxxxx>
>Subj: Re:  Question about Server Side Includes

Freddy Jensen wrote:
...
Hi.
Without being an expert on SSI, I do have the impression that your 
problem is this : the SSI processor does only one "pass" on your 
document.  Any "included" things must be (or generate) proper html on 
the first pass.  You cannot "pull in" something which would need a 
second SSI pass in order to be interpreted and generate html.

Note that there are probably ways to get around that, but not being the 
specialist, I don't know them.

>From: Torsten Foertsch <torsten.foertsch@xxxxxxx>
>Date: Tue Jul 28 2009 11:49am
>To:   "users@xxxxxxxxxxxxxxxx" <users@xxxxxxxxxxxxxxxx>
>Subj: Re:  Question about Server Side Includes

try it this way:

1) make the shell script accessible by an URL
   and configure mod_cgi for this URL
2) set the INCLUDES filter for this URL
3) use #include virtual instead of #exec

If you don't want the script to be exposed on the web you can use 
mod_rewrite's IS_SUBREQ variable. If it is false return a 404.

Now a bit of explanation, #exec simply executes the script and passes 
the output to the client. #include virtual issues a subrequest. That 
means the included document is accessed by an URL and can be configured 
independent of the main URL. It can be configured to be handled by 
mod_cgi and it can have assigned output filters. Now, when the INCLUDES 
filter of the subrequest sees the #set command it sets the variable. 
Then the main request's INCLUDES filter can access it. That's the 
theory.

Another option may be to configure the INCLUDES filter twice. But then 
you have to prevent the #if from being evaluated by the first run of 
the filter.

Torsten

========== End included message ==========


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux