Forum Moderators: phranque

Message Too Old, No Replies

RewriteMap causes httpd service to stop

RewriteMap

         

celocis

4:48 pm on Jun 23, 2011 (gmt 0)

10+ Year Member



hello,

i am trying to block visitors by ip address using a rewritemap file!
but can some one explain to me why httpd service wont start after i added this rule to the httpd.conf file:

<Directory /home/user/domains/domain.com/public_html>
RewriteEngine On
RewriteMap hosts-deny txt:/home/user/domains/domain.com/public_html/inc/hosts.deny
RewriteCond ${hosts-deny:%{REMOTE_HOST}|NOT-FOUND} !=NOT-FOUND [OR]
RewriteCond ${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND} !=NOT-FOUND
RewriteRule ^/.* [domain.com...]
</Directory>

rewritemap file hosts.deny containing:
63.41.231.56-

i need the hosts.deny file to be writable via php, so i guess this
should be in side the website folder?

The website is on a virtualhost!
does this mean it needs to be inside a <virtualhost 234.12.567.23> tag in the global httpd.conf file or inside the httpd.conf of the virtualhost its self?

i have tried both! but as soon as i add the rule and reboot the httpd service or apache server, the httpd service wont start any more?

and if i out command this line:
# RewriteMap hosts-deny txt:/home/user/domains/domain.com/public_html/inc/hosts.deny

it will start!
is the problem with the RewriteMap path or file permission?
file and folder are both chmod 777

any ideas or sugestions are greatly appreciated!