Ruby Forum Rails deployment > Securring a rails app deployed with passenger

Posted by Rasmus Nielsen (rasmus)
on 05.05.2008 17:35
Hi guys,

I want my rails app to be accessible from certain IPs only. I tried to
archieve this the way I was used to it in the PHP-world (in apache
vhost-setup):

<VirtualHost *:80>
        ServerName my.domain.com
        DocumentRoot /home/todo/public
        RailsEnv production
        <Directory />
        deny from all
        #allow from 1.1.1.1 #ip1
        #allow from 2.2.2.2 #ip2
        </Directory>
</VirtualHost>

All static files (css, js and so on) are prohibited for unknown IP as
they should, but my.domain.com/ is not! Rails just servers the HTML to
all visitors.

What can I do to restrict my site certain IPs?

Thanks!
Posted by Ivan V (Guest)
on 06.05.2008 12:01
(Received via mailing list)
I'm not an apache expert but I'm pretty sure that <Directory />
directive should say <Directory /home/todo/public>

On May 6, 1:35 am, Rasmus Nielsen <ruby-forum-incom...@andreas-s.net>
Posted by Rafael García (rafa)
on 06.05.2008 13:14
(Received via mailing list)
You must write allow directive into Proxy definition too.
Put your absolute path into Directory definition (as said Ivan).

Regards!
Rasmus Nielsen escribió:
>         <Directory />
> What can I do to restrict my site certain IPs?
>
> Thanks!
>   


--
Rafael Garcia Ortega
Posted by John Leach (Guest)
on 06.05.2008 16:58
(Received via mailing list)
On Mon, 2008-05-05 at 17:35 +0200, Rasmus Nielsen wrote:
> 
> All static files (css, js and so on) are prohibited for unknown IP as
> they should, but my.domain.com/ is not! Rails just servers the HTML to
> all visitors.
> 
> What can I do to restrict my site certain IPs?

Hi Rasmus,

That Directory section should be a Location section.  This is necessary
with the normal Apache proxying too as Apache isn't technically
accessing that directory, your Rails app is.

John.

--
http://www.brightbox.co.uk - UK Ruby on Rails hosting