Apache + Passenger で Basic 認証を設定したのでメモ。
myuser というユーザのパスワードファイルを作成する。
# htpasswd -c /usr/local/apache2/.htpasswd myuser
Apache の設定ファイルを修正する。
# vim /usr/local/apache2/conf/extra/passenger.conf
    PassengerUserSwitching off
    PassengerDefaultUser app
    ServerName example.com
    DocumentRoot "/srv/example.com/current/public"
    ErrorLog "logs/example.com-error_log"
    CustomLog "logs/example.com-access_log" common
    
        AllowOverride all
        Options -MultiViews
        Order allow,deny
        Allow from all
     
    
        AuthType Basic
        AuthName "Please enter your ID and Password"
        AuthUserFile /usr/local/apache2/.htpasswd
        Require user myuser
     
 
Apache の再起動
# service httpd restart
以上です。
【参考】