LoginSignup
5
2

More than 1 year has passed since last update.

LightsailのWordPressにBasic認証を設定する

Last updated at Posted at 2020-09-07

1. htaccess.conf 修正

vim /opt/bitnami/apps/wordpress/conf/htaccess.conf


※ 2021年 11月追記

下記のディレクトリに wordpress-htaccess.conf なるものができてました。
/opt/bitnami/apache/conf/vhosts/htaccess/

/opt/bitnami/apps ディレクトリが存在しない場合は、下記のファイルを書き換えてください。
vim /opt/bitnami/apache/conf/vhosts/htaccess/wordpress-htaccess.conf


末尾に下記追記

<Directory "/opt/bitnami/apps/wordpress/htdocs">
    AuthUserfile /home/bitnami/apps/wordpress/htdocs/.htpasswd
    AuthGroupfile /dev/null
    AuthName "Please enter your ID and password"
    AuthType Basic
    require valid-user
</Directory>

2. htpasswd ファイル作成

htpasswd -c /home/bitnami/apps/wordpress/htdocs/.htpasswd [ユーザー名]

3. apache 再起動

sudo /opt/bitnami/ctlscript.sh restart apache

以上!

5
2
0

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
5
2