<?xml version="1.0" encoding="utf-8"?>
		<feed xmlns="http://www.w3.org/2005/Atom">
		  <title type="text">Slicehost Forum - Blocking an IP Address with Passenger</title>
		  <updated>2010-09-09T18:51:09+00:00</updated>
		  <id>http://forum.slicehost.com/</id>
		  <link rel="alternate" type="text/html" hreflang="en" href="http://forum.slicehost.com/comments.php?DiscussionID=3993"/>
		  <link rel="self" type="application/atom+xml" href="http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Feed=Atom"/>
		  <generator uri="http://getvanilla.com/" version="1.1.8">
			 Lussumo Vanilla
		  </generator>
		  <entry>
		<title>Blocking an IP Address with Passenger</title>
		<link rel="alternate" href="http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Focus=21616#Comment_21616" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Focus=21616#Comment_21616</id>
		<published>2009-08-10T16:47:28+00:00</published>
		<updated>2010-09-09T18:51:09+00:00</updated>
		<author>
			<name>billhorsman</name>
			<uri>http://forum.slicehost.com/account.php?u=3302</uri>
		</author>
		<summary type="text" xml:lang="en">
			I want to block an IP and I'm using Apache and Passenger for my Rails app. The usual Apache approach doesn't seem to work:

  Order allow,deny
  Allow from all
  Deny from 1.2.3.4

I'm assuming ...
		</summary>
		<content type="html">
			<![CDATA[I want to block an IP and I'm using Apache and Passenger for my Rails app. The usual Apache approach doesn't seem to work:<br /><br />  Order allow,deny<br />  Allow from all<br />  Deny from 1.2.3.4<br /><br />I'm assuming that Apache has already handed over to mod_rails at this point. I can block static files (CSS, etc) but Rails is still called.<br /><br />Someone is doing repeated searches, several times a second from the same IP. I'd like to stop them doing that :)<br /><br />Thanks for your help.]]>
		</content>
	</entry>
	<entry>
		<title>Blocking an IP Address with Passenger</title>
		<link rel="alternate" href="http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Focus=21618#Comment_21618" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Focus=21618#Comment_21618</id>
		<published>2009-08-10T23:35:14+00:00</published>
		<updated>2009-08-10T23:35:31+00:00</updated>
		<author>
			<name>diazona</name>
			<uri>http://forum.slicehost.com/account.php?u=2216</uri>
		</author>
		<summary type="text" xml:lang="en">
			Are the Order/Allow/Deny lines in a &amp;lt;Location /&amp;gt; block?  If not, I'd put them in one and see if it makes a difference.

:) David
		</summary>
		<content type="html">
			<![CDATA[Are the Order/Allow/Deny lines in a <tt >&lt;Location /&gt;</tt> block?  If not, I'd put them in one and see if it makes a difference.<br /><br />:) David]]>
		</content>
	</entry>
	<entry>
		<title>Blocking an IP Address with Passenger</title>
		<link rel="alternate" href="http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Focus=21619#Comment_21619" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Focus=21619#Comment_21619</id>
		<published>2009-08-10T23:44:53+00:00</published>
		<updated>2010-09-09T18:51:09+00:00</updated>
		<author>
			<name>billhorsman</name>
			<uri>http://forum.slicehost.com/account.php?u=3302</uri>
		</author>
		<summary type="text" xml:lang="en">
			Hi David,

Sorry, I should have given more context. I've put them in a &amp;lt;Directory /&amp;gt; block


 &amp;lt;VirtualHost 4.5.6.7:80&amp;gt;
    ServerName www.example.com
    ...
		</summary>
		<content type="html">
			<![CDATA[Hi David,<br /><br />Sorry, I should have given more context. I've put them in a &lt;Directory /&gt; block<br /><br /><pre ><br /> &lt;VirtualHost 4.5.6.7:80&gt;<br />    ServerName www.example.com<br />    ServerAlias example.com<br />    DocumentRoot /home/myapp/rails/current/public<br />    CustomLog /var/log/apache2/myapp.log combined<br />    RailsEnv production<br />    &lt;Directory /home/myapp/rails/current/public&gt;<br />      Options FollowSymLinks<br />      Order allow,deny<br />      Allow from all<br />      Deny from 1.2.3.4<br />    &lt;/Directory&gt;<br />    RewriteEngine On<br />    RewriteCond %{HTTP_HOST} ^example.com<br />    RewriteRule (.*) http://www.example.com$1 [R=301,L]<br /> &lt;/VirtualHost&gt;<br /></pre><br /><br />Let me see if it works inside a &lt;Location /&gt; block. I'll respond shortly.<br /><br />-<br />Bill]]>
		</content>
	</entry>
	<entry>
		<title>Blocking an IP Address with Passenger</title>
		<link rel="alternate" href="http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Focus=21620#Comment_21620" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Focus=21620#Comment_21620</id>
		<published>2009-08-11T00:00:55+00:00</published>
		<updated>2010-09-09T18:51:09+00:00</updated>
		<author>
			<name>billhorsman</name>
			<uri>http://forum.slicehost.com/account.php?u=3302</uri>
		</author>
		<summary type="text" xml:lang="en">
			Hi again,

Yes, that worked :) I now realise the difference between &amp;lt;Directory&amp;gt; and &amp;lt;Location&amp;gt; and took the trouble to read the doc ...
		</summary>
		<content type="html">
			<![CDATA[Hi again,<br /><br />Yes, that worked :) I now realise the difference between &lt;Directory&gt; and &lt;Location&gt; and took the trouble to read the doc (http://httpd.apache.org/docs/2.2/sections.html). <br /><br />UPDATE:<br /><br />To start with, I didn't think it worked - but then I realised I wasn't paying attention to the status code that Apache was serving. Blush. Just to be sure, I switched back to just using &lt;Directory&gt; and discovered that it was working there too (serving up 403 codes). For the record, I guess that "/" works with  &lt;Directory&gt; or &lt;Location&gt;. <br /><br />Thanks for your help and sorry again for not paying attention in the first place.<br /><br />-<br />Bill]]>
		</content>
	</entry>
	<entry>
		<title>Blocking an IP Address with Passenger</title>
		<link rel="alternate" href="http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Focus=21623#Comment_21623" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Focus=21623#Comment_21623</id>
		<published>2009-08-11T03:17:16+00:00</published>
		<updated>2010-09-09T18:51:09+00:00</updated>
		<author>
			<name>diazona</name>
			<uri>http://forum.slicehost.com/account.php?u=2216</uri>
		</author>
		<summary type="text" xml:lang="en">
			Oh, no problem, you're not the only one who's missed the status codes ;-)  For what it's worth, &amp;lt;Location /&amp;gt; is the preferred way to apply a particular directive to everything on the ...
		</summary>
		<content type="html">
			<![CDATA[Oh, no problem, you're not the only one who's missed the status codes ;-)  For what it's worth, <tt >&lt;Location /&gt;</tt> is the preferred way to apply a particular directive to everything on the website.  (I'm not entirely sure why, but maybe there's a possibility that some URL could be considered not to be in any directory...)<br /><br />:) David]]>
		</content>
	</entry>
	
		</feed>