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

그러나 이것이 나에게 아파치 문제를 일으킨 원인입니다.

[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

먼저 자신의 상황을 확인해보세요. phpmyadmin, phpMyAdmin그리고 를 쓰세요 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.

관련 정보