EC2 Linux 2 / phpmyadminがサーバーに見つかりません。

EC2 Linux 2 / phpmyadminがサーバーに見つかりません。

このガイドに従ってLAMPを設置しました。 https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-lamp-amazon-linux-2.html

To install phpMyAdmin

Install the required dependencies.

[ec2-user ~]$ sudo yum install php-mbstring php-xml -y
Restart Apache.

[ec2-user ~]$ sudo systemctl restart httpd
Restart php-fpm.

[ec2-user ~]$ sudo systemctl restart php-fpm
Navigate to the Apache document root at /var/www/html.

[ec2-user ~]$ cd /var/www/html
Select a source package for the latest phpMyAdmin release from https://www.phpmyadmin.net/downloads. To download the file directly to your instance, copy the link and paste it into a wget command, as in this example:

[ec2-user html]$ wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz
Create a phpMyAdmin folder and extract the package into it with the following command.

[ec2-user html]$ mkdir phpMyAdmin && tar -xvzf phpMyAdmin-latest-all-languages.tar.gz -C phpMyAdmin --strip-components 1
Delete the phpMyAdmin-latest-all-languages.tar.gz tarball.

[ec2-user html]$ rm phpMyAdmin-latest-all-languages.tar.gz
(Optional) If the MySQL server is not running, start it now.

[ec2-user ~]$ sudo systemctl start mariadb
In a web browser, type the URL of your phpMyAdmin installation. This URL is the public DNS address (or the public IP address) of your instance followed by a forward slash and the name of your installation directory. For example:

http://my.public.dns.amazonaws.com/phpMyAdmin

これを実行した後、サーバーで11.11.111.11/phpmyadminが見つからないURLを取得します。

私は試みる:

sudo nano /etc/httpd/conf/httpd.conf

次へ追加

Include /var/www/html/phpmyadmin/httpd.conf

または

 Include /phpmyadmin/httpd.conf

しかし、これが私にApacheの問題を引き起こした原因です。

[ec2-user@server1 ~]$ sudo systemctl restart httpd
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
[ec2-user@server1 ~]$

編集する:

Jan 30 17:21:57 server1. systemd[1]: Stopped The Apache HTTP Server.
Jan 30 17:21:57 server1. systemd[1]: Starting The Apache HTTP Server...
Jan 30 17:21:57 server1..com httpd[14286]: httpd: Syntax error on line 362 of /etc/httpd/conf/httpd.conf: Could not open configuration file /etc/phpmyadmin/apache.conf: No such file
Jan 30 17:21:57 server1.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jan 30 17:21:57 server1.com systemd[1]: Failed to start The Apache HTTP Server.
Jan 30 17:21:57 server1.com systemd[1]: Unit httpd.service entered failed state.
Jan 30 17:21:57 server1.com systemd[1]: httpd.service failed.
Jan 30 18:02:08 server1.com systemd[1]: Starting The Apache HTTP Server...
Jan 30 18:02:08 server1.com systemd[1]: Started The Apache HTTP Server.

上記のコードを削除すると、Apacheが機能します。この問題は "include..." を試みるときに発生します。

phpmyadminを/var/www/html/PhpMyAdminで抽出した。

正しく抽出されました。このconfが見つからない理由と正しいファイルパスを追加する方法がわかりません。

ベストアンサー1

まず、自分の状況を確認してください。phpmyadminphpMyAdminそしてを書いてくださいPhpMyAdmin。正しく行ったことを確認してください。文書は解凍されている/var/www/html/phpMyAdminため、URLは次のようにする必要があります。http://xxxx/phpMyAdmin。大文字と小文字の区別が重要です!

もしそうなら、/var/www/html/の下のApache設定ファイルはどこから来ましたか?これ:

Include /var/www/html/phpmyadmin/httpd.conf

またはこれ

Include /phpmyadmin/httpd.conf

無意味。 Apache設定ファイルからそれを削除すると、ログに表示されるエラーが発生します。

Apacheの設定を確認したら、次のコマンドを実行してApache(および安全な場合はphp-fpm)を再ロードしてください。

» httpd -t
Syntax OK

# if not OK - fix it!

» systemctl restart httpd
» systemctl restart php-fpm

phpMyAdmin tarballにはApache設定ディレクティブは含まれていません。

以下を確認してください。http://xxxx/動作し(標準Apacheテストページを表示する必要があります)、以下の出力を表示する必要があります。http://xxxx/phpMyAdminもしtarballの圧縮を正しく解放しました/var/www/html/phpMyAdmin

おすすめ記事