Re: How to test whether a file exist in a ssi page?

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

 



On Fri, 2008-05-09 at 09:22 -0400, Joshua Slive wrote:
> On Fri, May 9, 2008 at 4:05 AM, Thorsten Scherler
> <thorsten.scherler.ext@xxxxxxxxxxxxxxxxxxx> wrote:
> > Hi all,
> >
> > how can I test whether a file exist in a ssi page?
> >
> > I have following
> > <!--#set var="name" value="$DOCUMENT_ROOT/2008/88/test.html" -->
> > which will return me the path of the file that I need to include if
> > exists.
> >
> > Now I want to test whether or not this file exists.
> >
> > A working but ugly way is the following:
> > <!--#config errmsg=""-->
> > <!--#include virtual="/2008/88/test.html"-->
> >
> > I would like to do something:
> > <!--#if expr="$DOCUMENT_ROOT/2008/88/test.html"-->
> > <!--#include virtual="/2008/88/test.html"-->
> > <!--#else -->
> > No information available.
> > <!--#endif -->
> >
> > Where I do not know which expression to use to do
> > expr="$DOCUMENT_ROOT/2008/88/test.html EXIST"
> >
> > TIA for any ideas.
> 
> See:
> http://httpd.apache.org/docs/2.2/mod/mod_include.html#ssienableaccess
> 
> I'm not actually sure if it works. I've never tried it, and I heard
> that the directive is actually named SSIAccessEnable rather than
> SSIEnableAccess.

Invalid command 'SSIEnableAccess', perhaps misspelled or defined by a
module not included in the server configuration
 failed!

Invalid command 'SSIAccessEnable', perhaps misspelled or defined by a
module not included in the server configuration
 failed!

Not sure whether I configured it the right way but I tried some
combinations. The last one is:

<VirtualHost 1.2.2.3:80>
 ServerName myServer 
 DocumentRoot "/opt/httpd"
 SSIAccessEnable on
...

I as well tried within
<Directory "/opt/httpd">

but I cannot start the server anymore after adding the "SSIAccessEnable
on". I am using a ubuntu package (2.2.3-3.2ubuntu2.1) on my developing
box.

However on our testing server we have apache_2.2.8 and adding
"SSIAccessEnable on" within the <Directory "/opt/httpd"> does not
provoke the server restart to fail but does not work either since:

<!--#if expr="-A /2008/88/test.html"-->
<!--#include virtual="/boletines/2008/88/test.html"-->
<!--#else -->
doh!
<!--#endif -->

will result in [an error occurred while processing this directive].

Any ideas?

salu2



> 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@xxxxxxxxxxxxxxxx
>    "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
> 
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


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