サーバ関連
目次
Apache Web ServerのBASIC認証を用いた認証設定の手順。
認証情報はhtpasswdコマンドを用いて行う。
htpasswd [PASSWD FILE] [USER]
htpasswd -c .htpasswd user
htpasswd .htpasswd user
パスワードファイルの保管場所は任意のディレクトリが使用できるが、FSHのルールから/etc配下に配置することが望ましい。
mkdir /etc/httpd/auth cd /etc/httpd/auth htpasswd -c .htpasswd user htpasswd .htpasswd user
ドキュメントルート以下へのアクセスに認証を設ける場合の設定。
実ディレクトリで構成されたコンテンツへのアクセスには認証を設けることができるが、Aliasを設定している場合には同様の設定を設ける必要がある。
<Directory /> Options FollowSymLinks AllowOverride None AuthType Basic AuthName "Please enter your password" AuthUserfile /etc/httpd/auth/.htpasswd Require ip 127.0.0.1 Require valid-user </Directory>