概要
webarenaでubuntu18.04やってみた。
apache2.4やってみた。
basic認証やってみた。
apache2.confの修正
<Directory /var/www/>
Options -Indexes -FollowSymLinks
AllowOverride All
Require all granted
</Directory>
.htpasswd作成
sudo htpasswd -c /var/www/html/.htpasswd hoge
.htaccess作成
AuthType basic
AuthName "Auth"
AuthUserFile /var/www/html/.htpasswd
Require valid-user
パーミッション設定。
sudo chmod 604 .htaccess
sudo chmod 604 .htpasswd
以上。