RE: ErrorDocument problem

2000-09-07 Thread BeerBong

Joshua, thanx for answer - I solve this problem already...

I had secured back-end server from direct client access. Only local proxy
requests was accepted. And after this condition I replaced IP address of
server with Real IP address of client. As result, on internal redirect (with
real address already) to ErrorDocument I got 404 File Not Found + additional
Forbidden on ErrorDocument redirect. (I did't see this text, because My
Explorer returns "friendly" response :)))
-
sub My::ProxyRemoteAddr ($)
{
my $r = shift;
return FORBIDDEN unless ($r-connection-remote_ip =~
"ip_address_of_my_server");
if (my ($ip) = $r-header_in('X-Real-IP') =~ /([^,\s]+)$/) {
  $r-connection-remote_ip($ip);
}
return OK;
}
-
I rewrite this sub - and now all is ok!
-
sub My::ProxyRemoteAddr ($)
{
my $r = shift;
return FORBIDDEN if (!($r-connection-remote_ip =~
"ip_address_of_my_server")  $r-prev  $r-prev-status != 404);
if (my ($ip) = $r-header_in('X-Real-IP') =~ /([^,\s]+)$/) {
  $r-connection-remote_ip($ip);
}
return OK;
}
-

 -Original Message-
 From: Joshua Chamas [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, September 07, 2000 2:14 PM
 To: BeerBong
 Cc: ModPerl
 Subject: Re: ErrorDocument problem


 I'm curious to know whether there's anything in your
 error_log if Debug is set to -2 for Apache::ASP, to
 see if Apache::ASP is handling the .asp request
 and not returning the right error code.  It should
 return the 404 just fine though and the ErrorDocument
 should pick it up from there.

 --Joshua

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




 BeerBong wrote:
 
  Hello all!
 
  I have a two apache server model (front-end - simple, back-end - power)
 
  I want return custom page on 404 status.
  .asp, .pl files are passed to back-end via mod_rewrite on
 simple Apache (I'm
  using Apache::ASP).
 
  When I trying to access
  1. /not_existing_file - works cgi script on simple, works fine
  2. /not_existing_file.asp - I get standart not found message,
 generated by
  browser!
  although
  3. /cgi-bin/error.pl - returns normal output generated by power apache.
 
  It seems that ErrorDocument for power Apache doesnt work...
  How I can fix this problem ? :(
 
  Part of httpd.conf
  ---
  IfDefine simple
ScriptAlias /cgi-bin/ /usr/web/cgi-bin/
Location /cgi-bin
  SetHandler cgi-script
/Location
 ErrorDocument 404 /cgi-bin/error.cgi
  /IfDefine
  IfDefine power
Alias /cgi-bin /usr/web/cgi-bin
Location /cgi-bin
  SetHandler perl-script
  PerlHandler Apache::Registry
  Options ExecCGI
  PerlSendHeader On
/Location
ErrorDocument 404 /cgi-bin/error.pl (error.pl is symbolic link to
  error.cgi)
  /IfDefine
  ---
 
  --
  Sergey Polyakov - chief of WebZavod
  http://www.webzavod.ru





ErrorDocument problem

2000-09-06 Thread BeerBong

Hello all!

I have a two apache server model (front-end - simple, back-end - power)

I want return custom page on 404 status.
.asp, .pl files are passed to back-end via mod_rewrite on simple Apache (I'm
using Apache::ASP).

When I trying to access
1. /not_existing_file - works cgi script on simple, works fine
2. /not_existing_file.asp - I get standart not found message, generated by
browser!
although
3. /cgi-bin/error.pl - returns normal output generated by power apache.

It seems that ErrorDocument for power Apache doesnt work...
How I can fix this problem ? :(


Part of httpd.conf
---
IfDefine simple
  ScriptAlias /cgi-bin/ /usr/web/cgi-bin/
  Location /cgi-bin
SetHandler cgi-script
  /Location
   ErrorDocument 404 /cgi-bin/error.cgi
/IfDefine
IfDefine power
  Alias /cgi-bin /usr/web/cgi-bin
  Location /cgi-bin
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
PerlSendHeader On
  /Location
  ErrorDocument 404 /cgi-bin/error.pl (error.pl is symbolic link to
error.cgi)
/IfDefine
---



--
Sergey Polyakov - chief of WebZavod
http://www.webzavod.ru




Re: ErrorDocument problem

2000-09-06 Thread Nouguier

BeerBong wrote:

 Hello all!

 I have a two apache server model (front-end - simple, back-end - power)

 I want return custom page on 404 status.
 .asp, .pl files are passed to back-end via mod_rewrite on simple Apache (I'm
 using Apache::ASP).

 When I trying to access
 1. /not_existing_file - works cgi script on simple, works fine
 2. /not_existing_file.asp - I get standart not found message, generated by
 browser!
 although
 3. /cgi-bin/error.pl - returns normal output generated by power apache.

 It seems that ErrorDocument for power Apache doesnt work...
 How I can fix this problem ? :(

 Part of httpd.conf
 ---
 IfDefine simple
   ScriptAlias /cgi-bin/ /usr/web/cgi-bin/
   Location /cgi-bin
 SetHandler cgi-script
   /Location
ErrorDocument 404 /cgi-bin/error.cgi
 /IfDefine
 IfDefine power
   Alias /cgi-bin /usr/web/cgi-bin
   Location /cgi-bin
 SetHandler perl-script
 PerlHandler Apache::Registry
 Options ExecCGI
 PerlSendHeader On
   /Location
   ErrorDocument 404 /cgi-bin/error.pl (error.pl is symbolic link to
 error.cgi)
 /IfDefine
 ---

 --
 Sergey Polyakov - chief of WebZavod
 http://www.webzavod.ru

Hi sergey,
Perhaps you should add FollowSymLinks to your Options...





RE: ErrorDocument problem

2000-09-06 Thread BeerBong



 -Original Message-
 From: BeerBong [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, September 06, 2000 5:37 PM
 To: Nouguier
 Subject: RE: ErrorDocument problem
 
 
 Nope, I tried to copy error.cgi to error.pl - result the same :(
 --
 Sergey Polyakov - chief of WebZavod
 http://www.webzavod.ru
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On 
  Behalf Of Nouguier
  Sent: Wednesday, September 06, 2000 5:28 PM
  To: BeerBong
  Cc: ModPerl
  Subject: Re: ErrorDocument problem
  
  
  BeerBong wrote:
  
   Hello all!
  
   I have a two apache server model (front-end - simple, 
 back-end - power)
  
   I want return custom page on 404 status.
   .asp, .pl files are passed to back-end via mod_rewrite on 
  simple Apache (I'm
   using Apache::ASP).
  
   When I trying to access
   1. /not_existing_file - works cgi script on simple, works fine
   2. /not_existing_file.asp - I get standart not found message, 
  generated by
   browser!
   although
   3. /cgi-bin/error.pl - returns normal output generated by 
 power apache.
  
   It seems that ErrorDocument for power Apache doesnt work...
   How I can fix this problem ? :(
  
   Part of httpd.conf
   ---
   IfDefine simple
 ScriptAlias /cgi-bin/ /usr/web/cgi-bin/
 Location /cgi-bin
   SetHandler cgi-script
 /Location
  ErrorDocument 404 /cgi-bin/error.cgi
   /IfDefine
   IfDefine power
 Alias /cgi-bin /usr/web/cgi-bin
 Location /cgi-bin
   SetHandler perl-script
   PerlHandler Apache::Registry
   Options ExecCGI
   PerlSendHeader On
 /Location
 ErrorDocument 404 /cgi-bin/error.pl (error.pl is symbolic link to
   error.cgi)
   /IfDefine
   ---
  
   --
   Sergey Polyakov - chief of WebZavod
   http://www.webzavod.ru
  
  Hi sergey,
  Perhaps you should add FollowSymLinks to your Options...