Rails, ウェブ

Apache + Mongrel / Thin で ベーシック認証

2008/03/04

迷ったのでメモ。
Apache (mod_proxy利用) + Mongrel でRailsアプリを設置している場合、Proxy * ディレクティブ内(11行目から16行目)にベーシック認証を記述します。下の場合、Railsアプリをlocalhost:3333で起動していますが、そのサーバがMongrelでもThinでもEbbでもなんでも構いません。とりあえずApacheにアクセスが行くので、ここにベーシック認証の記述を行っています。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<VirtualHost *:80>
ServerName hoge.org
ErrorLog logs/hoge-error.log
CustomLog logs/hoge-access.log combined
 
DocumentRoot /var/www/rails/hoge/public/
 
ProxyPass / http://localhost:3333/
ProxyPassReverse / http://localhost:3333/
 
<Proxy *>
AuthName "Access Password"
AuthUserFile /var/www/auth/.htpasswd
AuthType Basic
Require valid-user
</Proxy>
 
</VirtualHost>

related posts


tags

, , , ,


have your say

Add your comment below, or trackback from your own site. Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

:

:


« OpenID2.0の変更点
» Railsで使える高速サーバThin