rewrite results not as expected

rewrite results not as expected

Post by Obantec Suppor » Fri, 04 Jul 2003 04:40:39



Hi

i am testing an example ruleset from the rewrite guide but the log does not
show what i expected to see.

rule

Rewri*gine on
RewriteMap    hosts-deny  txt:/home/domain/domain1/logs/.hosts.deny
RewriteCond   ${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND} !=NOT-FOUND [OR]
RewriteCond   ${hosts-deny:%{REMOTE_HOST}|NOT-FOUND} !=NOT-FOUND
RewriteRule   ^/.*  -  [F]

extract of log shows

cache lookup OK: map=hosts-deny[txt] key=62.252.224.5 -> val=
RewriteCond: input='NOT-FOUND' pattern='!=NOT-FOUND' => not-matched
cache lookup OK: map=hosts-deny[txt] key=62.252.224.5 -> val=
RewriteCond: input='NOT-FOUND' pattern='!=NOT-FOUND' => not-matched

now i expected second condition to input key with remote_host
*inktomi2-lee.server.ntl.com* not the remote_addr.

since in the hosts.deny there will be ip's and hosts.

Any idea where i need to look?

Ultimate goal is to send a list of band ip's to a new url.

Mark

 
 
 

rewrite results not as expected

Post by Joshua Sli » Sat, 05 Jul 2003 00:46:18



> now i expected second condition to input key with remote_host
> *inktomi2-lee.server.ntl.com* not the remote_addr.

> since in the hosts.deny there will be ip's and hosts.

> Any idea where i need to look?

See the HostnameLookups directive.  With this set to off,
REMOTE_HOST is the same as REMOTE_ADDR.

Joshua.

 
 
 

rewrite results not as expected

Post by Obantec Suppor » Sat, 05 Jul 2003 02:57:48




Quote:

> > now i expected second condition to input key with remote_host
> > *inktomi2-lee.server.ntl.com* not the remote_addr.

> > since in the hosts.deny there will be ip's and hosts.

> > Any idea where i need to look?

> See the HostnameLookups directive.  With this set to off,
> REMOTE_HOST is the same as REMOTE_ADDR.

> Joshua.

Hi

It is off but a test script shows the expected values for REMOTE_HOST and
REMOTE_ADDR

REMOTE_ADDR = 62.252.224.5
REMOTE_HOST = inktomi2-lee.server.ntl.com

which throw me. (but i guess its the cache that is providing remote_host
var)

using a non cache connection and remote_host is gone.

Turning it On gives expected results.

So thanks i now understand and have reduced the rule just to remote_addr
since i am not interested in remote_host or the overhead of extra dns to
look up remote_host.

Mark

 
 
 

rewrite results not as expected

Post by Joachim Ri » Sat, 05 Jul 2003 06:02:57


Quote:> i am testing an example ruleset from the rewrite guide but the log does not
> show what i expected to see.

> rule

> Rewri*gine on
> RewriteMap    hosts-deny  txt:/home/domain/domain1/logs/.hosts.deny
> RewriteCond   ${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND} !=NOT-FOUND [OR]
> RewriteCond   ${hosts-deny:%{REMOTE_HOST}|NOT-FOUND} !=NOT-FOUND
> RewriteRule   ^/.*  -  [F]

> extract of log shows

> cache lookup OK: map=hosts-deny[txt] key=62.252.224.5 -> val=
> RewriteCond: input='NOT-FOUND' pattern='!=NOT-FOUND' => not-matched
> cache lookup OK: map=hosts-deny[txt] key=62.252.224.5 -> val=
> RewriteCond: input='NOT-FOUND' pattern='!=NOT-FOUND' => not-matched

> now i expected second condition to input key with remote_host
> *inktomi2-lee.server.ntl.com* not the remote_addr.

i suspect that you're lacking a HostnameLookups On clause in your
setup. it defaults to off since apache 1.3 and then there's no
symbolic name for clients available. beware though that this will add
latency to your pages and load to your network & server - so only use
it if absolutely necessary.

joachim

 
 
 

1. "host +" does not produce expected results.

I posted this message some time ago but it seems like nobody would want to
take a shot at it so I am posting this again just in case it was lost or
something.

I have problems using "host +" command to be able to use X session remotely.

When I type "host + hostname/IP address" this is what I'm getting:


Using domain server:
Name: dante.cenet.com
Address: 172.16.0.5
Aliases: dante

Host not found, try again.

To make it more interesting, I can ping this host without any problems and I
can traceroute it as well.  What does it refer to?

When I use ReflectionsX from my Windows machine, I have no problem executing
X window sessions from my Linux box. I just can't do this remotely.  Has
anybody have any idea what might be happening here?  I've been going nuts
trying to find out what's going on by going to man pages, searching How-tos
and so on but can't find an answer.

Any ideas?

--
Bolek,

URL: http://www.bolek.com

ICQ: 4086197
Address: 402905326

2. Installing natd

3. Q: Rewrite not rewriting anymore

4. 6.1 ppp start failed

5. please help: rewrite question: rewriting to a wrapper

6. Need to sepecify subnet mask with IP routes

7. Expect: expect vs. interact

8. cu and ttyS0 --> "no matching port"

9. Expect/Tcl Problem - "scripts expect Tcl version..."

10. expect and expecting it this way or this way...?

11. How to compile EXPECT was WANTED expect for Linux

12. expect for AIX where can I find freeware.expect.rte

13. expect-send pairs and sub expect-send pairs in chat