APM이 소스설치 경우
[root@JH-Server ~]# php -v
PHP 7.2.17 (cli) (built: Mar 25 2021 02:38:15) ( ZTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
[root@JH-Server ~]# mysql -V
/usr/local/mysql/bin/mysql Ver 15.1 Distrib 10.5.8-MariaDB, for Linux (x86_64) using readline 5.1
# ll /usr/local/
[root@JH-Server ~]# ll /usr/local
total 12
drwxr-xr-x 14 root root 152 Mar 24 23:54 apache
drwxr-xr-x 6 root root 54 Mar 24 23:52 apr
drwx--x--x 15 mysql mysql 4096 Mar 25 00:15 mysql
drwxr-xr-x 9 root root 81 Mar 25 02:38 php
# cd /usr/local/src
아래 버전은 php 버전이 7.1 MySQL/MariaDB 5.5 이상일 경우에 받는다
보통 phpMyAdmin은 php, mysql 버전에 따라 받아야하는 버전이 다르다. 주의해서 찾아서 다운받도록 하자.
# wget https://files.phpmyadmin.net/phpMyAdmin/5.1.0/phpMyAdmin-5.1.0-all-languages.tar.gz
# tar zxvf phpMyAdmin-5.1.0-all-languages.tar.gz
# mv /usr/local/src/phpMyAdmin-5.1.0-all-languages /usr/local/src/phpMyAdmin
httpd 설정
# vi /usr/local/apache/conf/httpd.conf
=========================================================
/DocumentRoot 검색 후 Root 디렉토리가 어디인지 확인할것
보통 소스설치면 /usr/local/apache/htdocs 일 경우가 많음
맨 밑에 줄에 추가
# phpMyAdmin settings
Include conf/extra/phpMyAdmin.conf
=========================================================
:wq
# vi /usr/local/apache/conf/extra/phpMyAdmin.conf
=========================================================
아래 내용 추가합니다.
Alias /phpMyAdmin /usr/local/apache/htdocs/phpMyAdmin/
<Directory /usr/local/apache/htdocs/phpMyAdmin/>
Require all granted
</Directory>
=========================================================
:wq
cp -arp /usr/local/apache/htdocs/phpMyAdmin/config.sample.inc.php /usr/local/apache/htdocs/phpMyAdmin/config.inc.php
/usr/local/apache/bin/apachectl -t
Syntax OK
Apache 데몬 스탑 후 시작
# /etc/init.d/apachectl stop
# /etc/init.d/apachectl start
인터넷창에서 url에서 http://도메인이름/phpMyAdmin 또는 http://나의 서버의 공인 IP/phpMyAdmin
후 로그인
APM이 yum 패키지 설치 경우
# rpm -qa | grep httpd
httpd-2.4.6-97.el7.centos.x86_64
httpd-devel-2.4.6-97.el7.centos.x86_64
# rpm -qa | grep mariadb
mariadb-5.5.68-1.el7.x86_64
mariadb-server-5.5.68-1.el7.x86_64
# rpm -qa | grep php
# httpd -v
Server version: Apache/2.4.6 (CentOS)
Server built: Nov 16 2020 16:18:20
# mysql -V
mysql Ver 15.1 Distrib 5.5.68-MariaDB, for Linux (x86_64) using readline 5.1
# php -v
PHP 5.4.16 (cli) (built: Apr 1 2020 04:07:17)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
# yum install -y phpmyadmin
# rpm -qa | grep phpMyAdmin
phpMyAdmin-4.4.15.10-4.el7.noarch
# vi /etc/http/conf/httpd.conf
=========================================================
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
ServerName localhost:80
<Directory />
AllowOverride none
Require all granted
</Directory>
<Directory "/usr/share/phpMyAdmin">
Require all granted
</Directory>
=========================================================
# vi /etc/httpd/conf.d/phpMyAdmin.conf
=========================================================
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 127.0.0.1 -> 0.0.0.0
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All -> Allow from All
Allow from 127.0.0.1 -> 0.0.0.0
Allow from ::1
</IfModule>
</Directory>
<Directory /usr/share/phpMyAdmin/setup/>
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 127.0.0.1 -> 0.0.0.0
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All -> Allow from All
Allow from 127.0.0.1 -> 0.0.0.0
Allow from ::1
</IfModule>
</Directory>
=========================================================
# mkdir /usr/share/phpMyAdmin/config
# chmod o+rw /usr/share/phpMyAdmin/config
이 작업을 하지 않으면 웹설정화면에서 "Cannot load or save configuration"라는 경고가 나온다.
# curl -s -I http://localhost/phpMyAdmin/ | head -3
HTTP/1.1 200 OK
인터넷창 url에서 http://공인 IP or 도메인/phpmyadmin 또는 http://공인 IP or 도메인/phpMyAdmin
접속이 된다.
'WEB & WAS > PHP' 카테고리의 다른 글
CentOS 7 PHP 5.6.40 소스 컴파일 설치 (0) | 2023.03.16 |
---|---|
CentOS 7 PHP 5.5.38 소스 컴파일 설치 (0) | 2023.03.16 |
CentOS 7 PHP 5.4.45 소스 컴파일 설치 (0) | 2023.03.16 |
CentOS 7 PHP 5.3.29 소스 컴파일 설치 (0) | 2023.03.16 |
CentOS 7 PHP 5.2.17 소스 컴파일 설치 (0) | 2023.03.16 |
댓글