You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Chris Hall <ch...@gmail.com> on 2005/07/06 15:22:01 UTC

[users@httpd] strange problem when SSI including jsp

I've recently setup apache 2.0.49 (SuSE Enterprise Linux 9 rpm
package) and Tomcat 5.5.9 (downloaded from jakarta site).  Everything
appears to be working great.

First some information:

moving apps from Websphere/IBM HTTP server to Tomcat/Apache

web document root: /srv/www/websiteX/htdocs
websiteX tomcat root: /usr/local/tomcat/webapps/websiteX

both directories have an "include" directory.  this is the way it was
setup before i got here.  static content (html, shtml, images, etc) is
the the web root, jsp and servlets in the tomcat root.

i've setup apache/tomcat so that static content gets handled by apache
and jsp/servlets get handed off to tomcat.

now the problem:

----- index.shtml snippet -----
... html ...
<!-- include a file from the websiteX/include dir -->
<!--#include virtual="include/somefile.htm" -->
... more html and more includes ...

<!-- this one works as well -->
<!-- include a jsp page from the tomcat websiteX/include dir -->
<!--#include virtual="include/foobar.jsp" -->

<!-- now every include breaks after the jsp -->
<!--#include virtual="include/someotherfile.htm" -->
.. more html and more includes ...
----- snippet -----

the jsp gets handled by Tomcat just fine and gets included in the
resulting HTML, however, every single include after that breaks.  the
Apache error log indicates that every SSI include after the jsp
include is looking in:

/srv/www/websiteX/htdocs/include/include

from the apache error log:

[Wed Jul 06 08:17:28 2005] [error] [client x.x.x.x] File does not
exist: /srv/www/websiteX/htdocs/include/include
[Wed Jul 06 08:17:28 2005] [error] [client x.x.x.x] unable to include
"include/bottomnav.htm" in parsed file
/srv/www/websiteX/htdocs/index.shtml

note the extra "include" directory.  of course, this directory does not exist.

If I comment out the jsp SSI include, all the SSI includes after it work.

Also, if i prepend all the include paths with a "/", everything works
great.  the issue is that this was working under websphere/ibm http
server without the "/"'s.

i've googled all over the place for answers and can't find any
discussions about this problem.  anyone have any ideas?  thanks.

Chris

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


Re: [users@httpd] SSI functions to compare dates?

Posted by Doug Lipman <do...@storydynamics.com>.
Thanks so much! I'll try PHP by the file.
Doug
>On 7/25/05, Doug Lipman <do...@storydynamics.com> wrote:
>>  Thanks so much, Joshua, for your helpful reply.
>>
>>  When you say,
>>  >>First, it is not necessary to rename your files to use PHP.  PHP can
>>  >be configured to work on any extension, not just .php
>>
>>  I take it that you mean I can configure PHP to parse all .html files
>>  in a web directory, by using an .htaccess file. If I do that, will I
>>  run the risk of a major slow-down of my site?
>
>You can also put a <Files> section inside an .htaccess file that
>activates php only for a single file.  If you do that, you probably
>wouldn't see any significant speed decrease.  And in any case, I'd
>guess that the difference between ssi and simple php probably isn't
>huge anyway.
>
>Joshua.
>
>---------------------------------------------------------------------
>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


-- 

***********************************************************************
Doug Lipman, P.O. Box 521165, Tulsa, OK 74152 
Phone: (918) 712-7336. Fax: (206) 202-7719. Toll-free: (888) 446-4738
Story DynamicsĂ…: workshops, performances, coaching

Web page: http://www.storydynamics.com
         Free monthly email newsletter, "eTips from the Storytelling Coach."
         "A wonderful, chock full of provocative ideas, storytelling 
newsletter. I like it a lot!" - Loretta Greene (Tempe, AZ)

Upcoming workshops: http://www.storydynamics.com/upcoming
The Soul of Hope: http://www.SoulOfHope.net
The Hasidic Stories Home Page: http://www.HasidicStories.com

***********************************************************************

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


Re: [users@httpd] SSI functions to compare dates?

Posted by Joshua Slive <js...@gmail.com>.
On 7/25/05, Doug Lipman <do...@storydynamics.com> wrote:
> Thanks so much, Joshua, for your helpful reply.
> 
> When you say,
> >>First, it is not necessary to rename your files to use PHP.  PHP can
> >be configured to work on any extension, not just .php
> 
> I take it that you mean I can configure PHP to parse all .html files
> in a web directory, by using an .htaccess file. If I do that, will I
> run the risk of a major slow-down of my site?

You can also put a <Files> section inside an .htaccess file that
activates php only for a single file.  If you do that, you probably
wouldn't see any significant speed decrease.  And in any case, I'd
guess that the difference between ssi and simple php probably isn't
huge anyway.

Joshua.

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


Re: [users@httpd] SSI functions to compare dates?

Posted by Doug Lipman <do...@storydynamics.com>.
Thanks so much, Joshua, for your helpful reply.

When you say,
>>First, it is not necessary to rename your files to use PHP.  PHP can
>be configured to work on any extension, not just .php

I take it that you mean I can configure PHP to parse all .html files 
in a web directory, by using an .htaccess file. If I do that, will I 
run the risk of a major slow-down of my site?

Doug
>On 7/25/05, Doug Lipman <do...@storydynamics.com> wrote:
>>  Hi,
>>
>>  I'm trying to use SSI (via XBitHack) to include a file or a bit of
>>  text in certain existing web pages only until a date I set in code.
>>  In other words, I want my pages to display certain text until an
>>  expiration date, and only until then. I know how to do this in PHP,
>>  but I don't want to have to rename my files from .html.
>
>First, it is not necessary to rename your files to use PHP.  PHP can
>be configured to work on any extension, not just .php.
>
>>
>>  This is how I've approached the problem:
>>
>>          <!--#set var="now_date" value="$DATE_LOCAL"-->
>>          <!--#set var="exp_date" value="[something goes here that is
>>  based on the date I want the include-file to stop appearing]"-->
>>          <!--#if expr='"now_date > exp_date"' -->
>>          <!--#include virtual="../../includes/file_to_include.inc" -->
>>          <!--#endif -->
>>
>>  Here are my questions:
>>  1. In the third line above, would now_date (derived from DATE_LOCAL)
>>  be in Unix time? Or else in what form?
>
>See
>http://httpd.apache.org/docs/2.0/mod/mod_include.html
>where you will find the "timefmt" option of the "config" element.
>
>>  2. Is there a function I can call in the second line above to encode
>>  a date into Unix time (or whatever the answer is to my first
>>  question?)
>
>Not as part of SSI.  You can generate that using standard time
>functions under c/perl/python/whatever.
>
>>
>>  Or, is there a better way to approach this problem?
>
>mod_rewrite can do rewriting conditional on date, which is an
>alternative approach.
>
>If you are most comfortable with php, I'd simply use that.
>
>Joshua.
>
>---------------------------------------------------------------------
>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


-- 

***********************************************************************
Doug Lipman, P.O. Box 521165, Tulsa, OK 74152 
Phone: (918) 712-7336. Fax: (206) 202-7719. Toll-free: (888) 446-4738
Story DynamicsĂ…: workshops, performances, coaching

Web page: http://www.storydynamics.com
         Free monthly email newsletter, "eTips from the Storytelling Coach."
         "A wonderful, chock full of provocative ideas, storytelling 
newsletter. I like it a lot!" - Loretta Greene (Tempe, AZ)

Upcoming workshops: http://www.storydynamics.com/upcoming
The Soul of Hope: http://www.SoulOfHope.net
The Hasidic Stories Home Page: http://www.HasidicStories.com

***********************************************************************

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


Re: [users@httpd] SSI functions to compare dates?

Posted by Joshua Slive <js...@gmail.com>.
On 7/25/05, Doug Lipman <do...@storydynamics.com> wrote:
> Hi,
> 
> I'm trying to use SSI (via XBitHack) to include a file or a bit of
> text in certain existing web pages only until a date I set in code.
> In other words, I want my pages to display certain text until an
> expiration date, and only until then. I know how to do this in PHP,
> but I don't want to have to rename my files from .html.

First, it is not necessary to rename your files to use PHP.  PHP can
be configured to work on any extension, not just .php.

> 
> This is how I've approached the problem:
> 
>         <!--#set var="now_date" value="$DATE_LOCAL"-->
>         <!--#set var="exp_date" value="[something goes here that is
> based on the date I want the include-file to stop appearing]"-->
>         <!--#if expr='"now_date > exp_date"' -->
>         <!--#include virtual="../../includes/file_to_include.inc" -->
>         <!--#endif -->
> 
> Here are my questions:
> 1. In the third line above, would now_date (derived from DATE_LOCAL)
> be in Unix time? Or else in what form?

See
http://httpd.apache.org/docs/2.0/mod/mod_include.html
where you will find the "timefmt" option of the "config" element.

> 2. Is there a function I can call in the second line above to encode
> a date into Unix time (or whatever the answer is to my first
> question?)

Not as part of SSI.  You can generate that using standard time
functions under c/perl/python/whatever.

> 
> Or, is there a better way to approach this problem?

mod_rewrite can do rewriting conditional on date, which is an
alternative approach.

If you are most comfortable with php, I'd simply use that.

Joshua.

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


[users@httpd] SSI functions to compare dates?

Posted by Doug Lipman <do...@storydynamics.com>.
Hi,

I'm trying to use SSI (via XBitHack) to include a file or a bit of 
text in certain existing web pages only until a date I set in code. 
In other words, I want my pages to display certain text until an 
expiration date, and only until then. I know how to do this in PHP, 
but I don't want to have to rename my files from .html.

This is how I've approached the problem:

	<!--#set var="now_date" value="$DATE_LOCAL"-->
	<!--#set var="exp_date" value="[something goes here that is 
based on the date I want the include-file to stop appearing]"-->
	<!--#if expr='"now_date > exp_date"' -->
	<!--#include virtual="../../includes/file_to_include.inc" -->
	<!--#endif -->

Here are my questions:
1. In the third line above, would now_date (derived from DATE_LOCAL) 
be in Unix time? Or else in what form?
2. Is there a function I can call in the second line above to encode 
a date into Unix time (or whatever the answer is to my first 
question?)

Or, is there a better way to approach this problem?

I'm running Linux Red Hat 9 and Apache 2.0.42.

Thanks!

Doug Lipman
-- 

***********************************************************************
Doug Lipman, P.O. Box 521165, Tulsa, OK 74152
Phone: (918) 712-7336. Fax: (206) 202-7719. Toll-free: (888) 446-4738
Story DynamicsĂ…: workshops, performances, coaching

Web page: http://www.storydynamics.com
         Free monthly email newsletter, "eTips from the Storytelling Coach."
         "A wonderful, chock full of provocative ideas, storytelling 
newsletter. I like it a lot!" - Loretta Greene (Tempe, AZ)

Upcoming workshops: http://www.storydynamics.com/upcoming
The Soul of Hope: http://www.SoulOfHope.net
The Hasidic Stories Home Page: http://www.HasidicStories.com

***********************************************************************

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