Re: Apache::ASP #include file

2000-08-26 Thread Joshua Chamas

Philip Mak wrote:
 
 Recently, I reinstalled mod_perl and Apache::ASP on my system in order to
 fix a problem I was having with ASP not using the new version of perl on
 my system. However, I'm having problem with some old code.
 
 I used to do this:
 
 In httpd.conf: PerlSetVar IncludesDir /home/goamembers/www
 In an ASP script: !--#include file="/index.inc"--
 
 Notice the "/" in "/index.inc". This would force it to get index.inc from
 /home/goamembers/www, instead of the current directory. This makes it kind
 of like !--#include virtual-- does with respect to filenames that start
 with "/" (but include virtual cannot be used to inline asp code).
 

That functionality was never intended to be supported, and 
am surprised it ever worked!  How painful would it be for
you to change your includes to be like !--#include file="index.inc"--

-- Joshua

_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks  free web link monitoring   Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051



Re: Apache::ASP #include file

2000-08-26 Thread joel reed

On Aug 26, [EMAIL PROTECTED] contorted a few electrons to say...
Philip  Philip Mak wrote:
Philip   
Philip   Recently, I reinstalled mod_perl and Apache::ASP on my system in order to
Philip   fix a problem I was having with ASP not using the new version of perl on
Philip   my system. However, I'm having problem with some old code.
Philip   
Philip   I used to do this:
Philip   
Philip   In httpd.conf: PerlSetVar IncludesDir /home/goamembers/www
Philip   In an ASP script: !--#include file="/index.inc"--
Philip   
Philip   Notice the "/" in "/index.inc". This would force it to get index.inc from
Philip   /home/goamembers/www, instead of the current directory. This makes it kind
Philip   of like !--#include virtual-- does with respect to filenames that start
Philip   with "/" (but include virtual cannot be used to inline asp code).
Philip   
Philip  
Philip  That functionality was never intended to be supported, and 
Philip  am surprised it ever worked!  How painful would it be for
Philip  you to change your includes to be like !--#include file="index.inc"--

while we are on this topic, is there any chance Apache::ASP could look
at IncludesDir when executing global.asa? it doesn't seem to AFAICT.

jr

-- 

Joel W. Reed412-257-3881
Verbosity leads to unclear, inarticulate things.



 PGP signature


Re: Apache::ASP #include file

2000-08-26 Thread Michael Robinton

  Recently, I reinstalled mod_perl and Apache::ASP on my system in order to
  fix a problem I was having with ASP not using the new version of perl on
  my system. However, I'm having problem with some old code.
  
 
 That functionality was never intended to be supported, and 
 am surprised it ever worked!  How painful would it be for
 you to change your includes to be like !--#include file="index.inc"--
 
apache_ssl and mod_perl co-exist nicely together, try that instead. I've 
a couple of these in production environments that work very well.

Michael



Re: Apache::ASP #include file

2000-08-26 Thread Philip Mak

On Sat, 26 Aug 2000, Michael Robinton wrote:

 apache_ssl and mod_perl co-exist nicely together, try that instead. I've 
 a couple of these in production environments that work very well.

I don't understand... what does SSL have to do with this?

-Philip Mak ([EMAIL PROTECTED])

   Recently, I reinstalled mod_perl and Apache::ASP on my system in order to
   fix a problem I was having with ASP not using the new version of perl on
   my system. However, I'm having problem with some old code.
   
  
  That functionality was never intended to be supported, and 
  am surprised it ever worked!  How painful would it be for
  you to change your includes to be like !--#include file="index.inc"--
  





Re: Apache::ASP #include file

2000-08-26 Thread Michael Robinton


 On Sat, 26 Aug 2000, Michael Robinton wrote:
 
  apache_ssl and mod_perl co-exist nicely together, try that instead. I've 
  a couple of these in production environments that work very well.
 
 I don't understand... what does SSL have to do with this?
 
 -Philip Mak ([EMAIL PROTECTED])
 
Oops, responded to the wrong thread ... gotta backup and take another look



Apache::ASP #include file, relative filenames

2000-05-21 Thread Philip Mak

On Sun, 21 May 2000, Joshua Chamas wrote:

  So, there's no way in Apache::ASP to include a file by specifying a path
  relative to DOCUMENT_ROOT, or relative to the directory of the current
  file (which is not necessarily equivalent to the request URI, if the
  current file is included)?

 !--#include file= -- allows relative file specifications.
 Did it not work for you for some reason?

It does not work in this kind of situation:

/series/slayers/lina/index.inc does !--#include file="../index.inc"--
/series/slayers/index.inc does !--#include file="../index.inc"--

If I access http://.../series/slayers/lina/index.inc, then it will do the
first include correctly. But in the second include, it resolves the
path name relative to /series/slayers/lina/ instead of /series/slayers/,
so it ends up including /series/slayers/index.inc instead of
/series/index.inc.

I worked around this by doing "PerlSetVar IncludesDir /home/goamembers/www"
(which is my DOCUMENT_ROOT), and then using includes such as:

!--#include file="/series/slayers/index.inc"--
!--#include file="/series/slayers/lina/index.inc"--

-Philip Mak ([EMAIL PROTECTED])




Re: Apache::ASP #include file, relative filenames

2000-05-21 Thread Joshua Chamas

Philip Mak wrote:
 
 On Sun, 21 May 2000, Joshua Chamas wrote:
 
   So, there's no way in Apache::ASP to include a file by specifying a path
   relative to DOCUMENT_ROOT, or relative to the directory of the current
   file (which is not necessarily equivalent to the request URI, if the
   current file is included)?
 
  !--#include file= -- allows relative file specifications.
  Did it not work for you for some reason?
 
 It does not work in this kind of situation:
 
 /series/slayers/lina/index.inc does !--#include file="../index.inc"--
 /series/slayers/index.inc does !--#include file="../index.inc"--
 

I see, yes this would not have worked, because Apache::ASP
does a chdir() to whereever the script is.  So what you could
do might be to have a header.inc which does something like...

% 
  use File::Basename;
  my $dirname = dirname($0);
  $dirname =~ s|^$ENV{DOCUMENT_ROOT}/?||;
  my $up = '';
  for(split(/\//, $dirname)) {
$up .= '../'; 
my $include = $up.'index.inc';   
if(-e $include) {
  $Response-Include($include);
}
  }   
%

--Joshua

_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks  free web link monitoring   Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051