LoginSignup
12

More than 5 years have passed since last update.

ApacheでBasic認証の設定

Posted at

Basic認証の設定。
何となく毎回、調べることになるのでメモ。

command
$ vi .htaccess

で、中身が以下。

text
order allow,deny
allow from all
Authname "Secret site"
Authtype Basic
AuthUserFile /var/www/html/www.サイト名/.htpasswd
require valid-user

ユーザの新規作成

command
htpasswd -c /var/www/html/www.サイト名/.htpasswd ユーザ名

ユーザの追加作成

command
htpasswd /var/www/html/www.サイト名/.htpasswd ユーザ名

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12