You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Scott Ellentuch <tu...@ttsg.com> on 2001/11/20 05:16:28 UTC

mod_rewrite/8808: Unsure example from Guide is working as implemented

>Number:         8808
>Category:       mod_rewrite
>Synopsis:       Unsure example from Guide is working as implemented
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Mon Nov 19 20:20:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     tuc@ttsg.com
>Release:        1.3.22
>Organization:
apache
>Environment:
BSD/OS 3.1, fully patched. gcc 2.7.2.1
>Description:
According to documentation, RewriteMap is not allowed in .htaccess. So, I thought that I
can just put into httpd.conf as :

<VirtualHost cgitest.ttsg.com>
ServerAdmin webmaster@ttsg.com
DocumentRoot /path/sub.domain.com
Servername sub.domain.com
ErrorLog "|/usr/local/bin/cronolog /usr/local/logs/%Y%m%d/sub-error_log"
TransferLog "|/usr/local/bin/cronolog /usr/local/logs/%Y%m%d/sub-access_log"
UserDir disabled
HostNameLookups off
IdentityCheck off
ScriptAlias /lcgi-bin/ /path/sub.domain.com/lcgi-bin/
<Location /lcgi-bin>
Action cgi-wrapper /cgi-bin/cgiwrap/user
SetHandler cgi-wrapper
</Location>
RewriteLogLevel 9
RewriteLog      "|/usr/local/bin/cronolog /usr/local/logs/%Y%m%d/sub-rewrite
_log"
RewriteMap     hosts-deny      txt:/path/sub.domain.com/lcgi-bin/deny
</VirtualHost>


Then, I tried to put the rest in an .htaccess in the /path/sub.domain.com directory :

RewriteEngine  on
RewriteCond    ${hosts-deny:%{REMOTE_HOST}|NOT-FOUND}  !=NOT-FOUND [OR]
RewriteCond    ${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND}  !=NOT-FOUND
RewriteRule    ^/lcgi-bin/denied.cgi     -       [F]

and the content of /path/sub.domain.com/lcgi-bin/deny :

A.A.A.A	-
B.B.B.B	-
C.C.C.C -

Running as is, I get no input anywhere when attempting from A.A.A.A to
http://sub.domain.com/lcgi-bin/denied.cgi

I figured if I put "RewriteEngine on" in the httpd.conf it might help. At that point,
the server only returns immediately without ANYTHING.

The reason I'm putting ONLY the RewriteMap into the httpd.conf is so that I can be
very flexible in the .htaccess usage. Its confusing to have some .htaccess things in
directories, and some in httpd.conf

This is almost 100% to the Guide.  

Am I doing something wrong, unexpected, or stupid?
>How-To-Repeat:
See above.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
 [In order for any reply to be added to the PR database, you need]
 [to include <ap...@Apache.Org> in the Cc line and make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]