lamp平台部署phpMyAdmin

lamp平台部署phpmyadmin

环境需要提前部署好lamp架构,详细过程参考《lamp架构的部署》

[root@zzd139 ~]# ss -antl
State           Recv-Q          Send-Q                   Local Address:Port                    Peer Address:Port          Process          
LISTEN          0               128                            0.0.0.0:22                           0.0.0.0:*                              
LISTEN          0               128                          127.0.0.1:9000                         0.0.0.0:*                              
LISTEN          0               128                                  *:80                                 *:*                              
LISTEN          0               128                               [::]:22                              [::]:*                              
LISTEN          0               80                                   *:3306                               *:* 

//下载phpmyadmin的包
[root@zzd139 ~]# wget https://files.phpmyadmin.net/phpMyAdmin/5.2.0/phpMyAdmin-5.2.0-all-languages.zip

//解压phpmyadmin
[root@zzd139 ~]# mv phpMyAdmin-5.2.0-all-languages.zip /usr/local/apache/htdocs/
[root@zzd139 ~]# cd /usr/local/apache/htdocs/
[root@zzd139 htdocs]# unzip phpMyAdmin-5.2.0-all-languages.zip
[root@zzd139 htdocs]# ls
index.html  phpMyAdmin-5.2.0-all-languages  phpMyAdmin-5.2.0-all-languages.zip  zzd
[root@zzd139 htdocs]# mv phpMyAdmin-5.2.0-all-languages.zip ~/
[root@zzd139 htdocs]# mv phpMyAdmin-5.2.0-all-languages/ phpMyAdmin
 
[root@zzd139 htdocs]# cd phpMyAdmin/
[root@zzd139 phpMyAdmin]# ls
babel.config.json  config.sample.inc.php  favicon.ico  LICENSE       RELEASE-DATE-5.2.0      sql        vendor
ChangeLog          CONTRIBUTING.md        index.php    locale        robots.txt              templates  yarn.lock
composer.json      doc                    js           package.json  setup                   themes
composer.lock      examples               libraries    README        show_config_errors.php  url.php
[root@zzd139 phpMyAdmin]# mv config.sample.inc.php config.inc.php

//配置虚拟主机
[root@zzd139 phpMyAdmin]# vim /usr/local/apache/conf/extra/httpd-vhosts.conf
//添加以下内容
<VirtualHost *:80>
    DocumentRoot "/usr/local/apache/htdocs/phpMyAdmin"
    ServerName phpMyAdmin.example.com
    ErrorLog "logs/phpMyAdmin.example.com-error_log"
    CustomLog "logs/phpMyAdmin.example.com-access_log" common
    ProxyRequests Off
    ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/usr/local/apache/htdocs/phpMyAdmin/$1
    <Directory "/usr/local/apache/htdocs/phpMyAdmin">
        Options none
        AllowOverride none
        Require all granted
    </Directory>
</VirtualHost>

//重启httpd服务
[root@zzd139 ~]# systemctl restart httpd.service 

//在物理机C:\Windows\System32\drivers\etc\hosts文件下添加域名映射
192.168.169.139 phpMyAdmin.example.com

访问域名phpMyAdmin.example.com

输入mysql的用户名和密码,然后登录

posted @ 2022-08-04 00:05  Zic师傅  阅读(27)  评论(0编辑  收藏  举报