httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sullivan N. Beck" <sb...@cise.ufl.edu>
Subject [users@httpd] Recursive server side includes failing
Date Thu, 10 Apr 2003 21:19:05 GMT

I've got a situation where I've got a recursive server side include
file.  In other words:

  index.shtml includes a.shtml
  a.shtml includes b.shtml
  b.shtml includes a.shtml

I realize this may not be the best setup, but I'd like to get it
working.

The first time a.shtml is included, it works.  The second time it fails
with "an error occurred while processing this directive".  The directive
that fails is the actual include directive, not something that's inside
the a.shtml file.

This happens under both:

  apache_1.3.27+mod_ssl-2.8.14
  apache_1.3.26+mod_ssl-2.8.10

on Solaris 8.  I'll be happy to give any other config information about
our setup if necessary.  I've included a simple set of shtml files
below which exhibit this behavior.

My question is, is this form of recursion allowed (I haven't seen it
explicitely disallowed in any of the SSI documentation I've read), but
my test case seems so simple, that I think it might be.

Incidentally, what we're doing (trying) is treating a bunch of our pages
as a hierarchy and then in each page, seeing where you are in the
hierarchy in a fairly simple way without resorting to CGI.

======
/help/foo2/index.shtml:

<!-- 01 --> <!--#set var="parent"      value="" -->
<!-- 10 --> <!--#if expr="$recursing" -->
<!-- 11 -->    <!--#include virtual="/includes/z-recurse.shtml" -->
<!-- 20 --> <!--#else -->
<!-- 21 -->    <!--#include virtual="/includes/z-recurse.shtml" -->

<HTML>
/ Foo /
</HTML>

<!-- 99 --> <!--#endif -->

======
/help/foo2/a.shtml:

<!-- 01 --> <!--#set var="parent"      value="/help/foo2/index.shtml" -->
<!-- 10 --> <!--#if expr="$recursing" -->
<!-- 11 -->    <!--#include virtual="/includes/z-recurse.shtml" -->
<!-- 20 --> <!--#else -->
<!-- 21 -->    <!--#include virtual="/includes/z-recurse.shtml" -->

<HTML>
/ Foo / A
</HTML>

<!-- 99 --> <!--#endif -->

======
/includes/z-recurse.shtml:

<!-- 100 --> <!--#set var="recursing" value="yes" -->
<!-- 110 --> <!--#if expr="$parent" -->
<!-- 120 -->    <!-- include <!--#echo var="parent" --> -->
<!-- 130 -->    <!--#include virtual="$parent"  -->
<!-- 140 --> <!--#endif -->

======
The output from loading the a.shtml web page is:

<!-- 01 --> 
<!-- 10 --> 
<!-- 21 -->    
<!-- 100 --> <!-- parent = /help/foo2/index.shtml -->
<!-- 110 --> 
<!-- 120 --> 
<!-- 130 -->
<!-- 01 --> 
<!-- 10 --> 
<!-- 11 -->    [an error occurred while processing this directive]
<!-- 20 --> 
<!-- 140 --> 

<HTML>
/ Foo / A
</HTML>

<!-- 99 --> 

So in the above, at label 21, z-recurse.shtml is loaded which loads
index.shtml (at label 130) which trys to load z-recurse.shtml again
at label 11.

If anyone has any suggestions, I'd really appreciate knowing what's
going on.  I hope I'm not doing something too stupid, but I've been
looking at this for too many hours without seeing it if I am.

Thanks for any help.





--------------------------|  Sullivan Beck  |---------------------------
mailto:sbeck@cise.ufl.edu          |            Senior System Programmer
http://www.cise.ufl.edu/~sbeck     |               University of Florida
PH : (352) 392-1057                |                     CISE Department
Fax: (352) 392-1220                |                            CSE 314E
                                   |         Gainesville, FL  32611-6120
------------------------------------------------------------------------


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message