last-modified: 2019-04-28 (日) 18:36:58 (1834d)[変更箇所]
htpasswd -c .htpasswd username
でユーザー・パスワードを設定する。-cはファイルを作るというオプション。2人目のユーザーの追加の時には
htpasswd .htpasswd username
で良い。次にアクセス設定ファイル.htaccessを作成する。以下は例。
AuthType Basic AuthName "Please enter username and password" AuthUserFile /home/xxx/xxx/xxx/.htpasswd AuthGroupFile /dev/null
AuthGroupFile?の行はグループごとのアクセスをしないという意味。 さらにCGIを使いたい場合は
Options +ExecCGI AddType application/x-httpd-cgi .cgi
を追加する。