とにかく最速で手間なくやりたい。
どうせ一時的なものだしね。
CentOS7で確認。
Basic認証設定
vi /etc/httpd/conf/httpd.conf
<Directory "/var/www/html"> # # Controls who can get stuff from this server. # Require all granted </Directory>
<Directory "/var/www/html"> AuthType Basic AuthName "Basic Auth" AuthUserFile /etc/httpd/conf/.htpasswd Require valid-user </Directory>
認証ユーザ作成
sudo htpasswd -c /etc/httpd/conf/.htpasswd username
> pass
> pass
> pass
> pass
確認
apachectl configtest
apache再起動
sudo systemctl reload httpd
参考
https://qiita.com/mmotoi/items/5d7dcbb9e461feba98cd