LoginSignup
12
11

More than 5 years have passed since last update.

AWS Lightsailの設計図でWordPressを選択したときのphpMyAdminの設定

Posted at

AWS LightsailでWordPressインストールを試してみました。数分でサイトが立ち上がりました。

lightsail_wordpress_phpmyadmin.PNG

SSHでログインしたところphpmyadminフォルダが存在していたため、ブラウザ経由で以下のURLで接続を試みましたがエラーメッセージが表示され接続できませんでした。

URL
http://[パブリックIP]/phpmyadmin

エラーメッセージ

For security reasons, this URL is only accessible using localhost (127.0.0.1) as the hostname.

アクセスできるように設定を変更しましょう。

設定方法

メッセージの通り、localhostからの接続のみ許可されているため、設定ファイルを変更します。

ファイル
/opt/bitnami/apps/phpmyadmin/conf/httpd-app.conf

設定内容

固定IPアドレスを許可する場合

<IfVersion >= 2.3>
Require ip [許可するIPアドレスを記入]
Require local
</IfVersion>

すべての接続を許可する場合

※別途Basic認証とかかけましょう

<IfVersion >= 2.3>
Require all granted
</IfVersion>

IPが許可されていない場合Basic認証を表示

<RequireAny>
Require ip [許可するIPアドレスを記入]
AuthType basic
AuthName "Secure Zone"
AuthUserFile [/path/to/.htpasswd]
Require valid-user
</RequireAny>

設定変更後、以下のコマンドでApacheを再起動します。

sudo /opt/bitnami/ctlscript.sh restart apache

※graceful, reload系のオプションは用意されていませんでした。

bitnami@ip-172-26-9-155:~$ sudo /opt/bitnami/ctlscript.sh
usage: /opt/bitnami/ctlscript.sh help
       /opt/bitnami/ctlscript.sh (start|stop|restart|status)
       /opt/bitnami/ctlscript.sh (start|stop|restart|status) mysql
       /opt/bitnami/ctlscript.sh (start|stop|restart|status) php-fpm
       /opt/bitnami/ctlscript.sh (start|stop|restart|status) apache

help       - this screen
start      - start the service(s)
stop       - stop  the service(s)
restart    - restart or start the service(s)
status     - show the status of the service(s)

lightsail_wordpress_phpmyadmin2.PNG

見れました!

デフォルトのユーザー名はroot、ログインパスワードは以下のファイルに記載してあります
cat /home/bitnami/bitnami_application_password

12
11
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
12
11