LoginSignup
4
4

More than 1 year has passed since last update.

AWS Lightsailでphpmyadminにアクセスする

Last updated at Posted at 2021-05-03

Lightsailで、LAMP環境を立ち上げたのですが、phpmyadminへのアクセスを試みたものの、
セキュリティ設定がされているようで、試行錯誤したので、メモを残しておきます。

先人たちの教えに基づき、あれこれ試したものの、肝心のフォルダがないという惨劇。。。
/opt/bitnami/apps のフォルダが、、、ない。
2021-05-03_12h35_46.png

設定ファイルの場所

で、結局、どこに目当てのファイルがあったかというと、、、ここにありました!!

/opt/bitnami/apache/conf/bitnami/phpmyadmin.conf

Require local を 以下の用意に書き換えます。
2021-05-03_12h41_34.png

Alias /phpmyadmin "/opt/bitnami/phpmyadmin"
<Directory "/opt/bitnami/phpmyadmin">
  Options -Indexes +FollowSymLinks -MultiViews
  #AllowOverride All
  AllowOverride None
  #Require local
  <IfVersion < 2.3>
  Order allow,deny
  Allow from all
  Satisfy all
  </IfVersion>
  <IfVersion >= 2.3>
  Require all granted
  </IfVersion>
  ErrorDocument 403 "For security reasons, this URL is only accessible using localhost (127.0.0.1) as the hostname."
  # AuthType Basic
  # AuthName phpmyadmin
  # AuthUserFile "/opt/bitnami/apache/conf/users"
  # Require valid-user
</Directory>

変更したら、以下のコマンドで、apacheを再起動します。

sudo /opt/bitnami/ctlscript.sh restart

アクセスの確認

http://[IPアドレス]/phpmyadmin にアクセスしてみます。
以下のログイン画面が表示されれば、設定は成功です!!

2021-05-03_12h47_04.png

補足: ユーザー名とパスワードの取得

phpmyadminのアクセスに必要なパスワードは、以下の手順で取得できます。

ホームディレクトリで、以下のコマンドを実行

cat bitnami_credentials

パスワードが表示されるのでコピーする。

ユーザー名は、root です。

 

4
4
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
4
4