<rss version="2.0">
		<channel>
			<title>Slicehost Forum - Blocking an IP Address with Passenger</title>
			<lastBuildDate>Thu, 09 Sep 2010 18:42:27 +0000</lastBuildDate>
			<link>http://forum.slicehost.com/</link>
			<description></description>
			<generator>Lussumo Vanilla 1.1.8</generator>
			<item>
		<title>Blocking an IP Address with Passenger</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Focus=21616#Comment_21616</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Focus=21616#Comment_21616</guid>
		<pubDate>Mon, 10 Aug 2009 16:47:28 +0000</pubDate>
		<author>billhorsman</author>
		<description>
			<![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.]]>
		</description>
	</item>
	<item>
		<title>Blocking an IP Address with Passenger</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Focus=21618#Comment_21618</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Focus=21618#Comment_21618</guid>
		<pubDate>Mon, 10 Aug 2009 23:35:14 +0000</pubDate>
		<author>diazona</author>
		<description>
			<![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]]>
		</description>
	</item>
	<item>
		<title>Blocking an IP Address with Passenger</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Focus=21619#Comment_21619</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Focus=21619#Comment_21619</guid>
		<pubDate>Mon, 10 Aug 2009 23:44:53 +0000</pubDate>
		<author>billhorsman</author>
		<description>
			<![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]]>
		</description>
	</item>
	<item>
		<title>Blocking an IP Address with Passenger</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Focus=21620#Comment_21620</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Focus=21620#Comment_21620</guid>
		<pubDate>Tue, 11 Aug 2009 00:00:55 +0000</pubDate>
		<author>billhorsman</author>
		<description>
			<![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]]>
		</description>
	</item>
	<item>
		<title>Blocking an IP Address with Passenger</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Focus=21623#Comment_21623</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3993&amp;Focus=21623#Comment_21623</guid>
		<pubDate>Tue, 11 Aug 2009 03:17:16 +0000</pubDate>
		<author>diazona</author>
		<description>
			<![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]]>
		</description>
	</item>
	
		</channel>
	</rss>