症状
- ApacheでBasic認証をしたいがフルパス記述にしたりどう頑張っても500エラーを吐かれる
/var/log/apache2/error.logにInvalid command 'AuthGroupfile', perhaps misspelled or defined by a module not included in the server configurationというエラーが出る
原因
Apacheでbasic認証する方法として以下のやりかたを紹介するサイトが多いですが嘘です。
[.htaccess]
AuthUserfile /var/www/html/.htpasswd
AuthGroupfile /dev/null
AuthName "Please enter your ID and password"
AuthType Basic
require valid-user
解決方法
AuthGroupfile /dev/null を消します。
[.htaccess]
AuthUserfile /var/www/html/.htpasswd
AuthName "Please enter your ID and password"
AuthType Basic
require valid-user