天天看點

lamp分離部署+phpmyadmin

環境說明:

服務類型 IP位址 應用 系統平台
httpd 192.168.93.129 httpd

centos7

redhat7

mysql 192.168.93.130 mysql

centos7

redhat7

php 192.168.93.131

php

phpmyadmin

centos7

redhat7

httpd伺服器配置:

//關閉防火牆和selinux

[[email protected] ~]# systemctl stop firewalld
[[email protected] ~]# systemctl disable firewalld
[[email protected] ~]# getenforce 
Disabled
           

//下載下傳開發工具包

[[email protected] ~]# yum groups mark install 'Development Tools'
           

//建立apache服務的使用者群組

[[email protected] ~]# groupadd -r apache
[[email protected] ~]# useradd -r -M -s /sbin/nologin -g apache apache 
           

//安裝依賴包

[[email protected] ~]# yum -y install openssl-devel pcre-devel expat-devel libtool
......
作為依賴被安裝:
  keyutils-libs-devel.x86_64 0:1.5.8-3.el7                               
  krb5-devel.x86_64 0:1.15.1-8.el7                                       
  libcom_err-devel.x86_64 0:1.42.9-10.el7                                
  libkadm5.x86_64 0:1.15.1-8.el7                                         
  libselinux-devel.x86_64 0:2.5-11.el7                                   
  libsepol-devel.x86_64 0:2.5-6.el7                                      
  libverto-devel.x86_64 0:0.2.5-4.el7                                    
  zlib-devel.x86_64 0:1.2.7-17.el7                                       

完畢!
           

//下載下傳和安裝apr以及apr-util

[[email protected] ~]# cd /usr/src/
[[email protected] src]# ls
debug  kernels
[[email protected] src]# wget http://mirror.bit.edu.cn/apache/apr/apr-1.6.5.tar.gz
[[email protected] src]# wget http://mirror.bit.edu.cn/apache/apr/apr-util-1.6.1.tar.gz
[[email protected] src]# ls
apr-1.6.5.tar.gz  apr-util-1.6.1.tar.gz  debug  kernels
[[email protected] src]# tar xf apr-1.6.5.tar.gz 
[[email protected] src]# tar xf apr-util-1.6.1.tar.gz 
[[email protected] src]# ls
apr-1.6.5         apr-util-1.6.1         debug
apr-1.6.5.tar.gz  apr-util-1.6.1.tar.gz  kernels
[[email protected] src]# cd apr-1.6.5
[[email protected] apr-1.6.5]# vim configure
   cfgfile=${ofile}T
    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
 #   $RM "$cfgfile"   //将此行删除或者加上注釋
[[email protected] apr-1.6.5]# ./configure --prefix=/usr/local/apr
[[email protected] apr-1.6.5]# make && make install
[[email protected] apr-1.6.5]# cd /usr/src/apr-util-1.6.1
[[email protected] apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
[[email protected] apr-util-1.6.1]# make && make install
           

//編譯安裝httpd

[[email protected] ~]# wget http://mirror.bit.edu.cn/apache/httpd/httpd-2.4.38.tar.gz
[[email protected] ~]# ls
anaconda-ks.cfg  httpd-2.4.38.tar.gz
[[email protected] ~]# tar xf httpd-2.4.38.tar.gz 
[[email protected] ~]# ls
anaconda-ks.cfg  httpd-2.4.38  httpd-2.4.38.tar.gz
[[email protected] ~]# cd httpd-2.4.38
[[email protected] httpd-2.4.38]# ./configure --prefix=/usr/local/apache \
> --sysconfdir=/etc/httpd24 \
> --enable-so \
> --enable-ssl \
> --enable-cgi \
> --enable-rewrite \
> --with-zlib \
> --with-pcre \
> --with-apr=/usr/local/apr \
> --with-apr-util=/usr/local/apr-util/ \
> --enable-modules=most \
> --enable-mpms-shared=all \
> --with-mpm=prefork
[[email protected] httpd-2.4.38]# make && make install
           

//安裝後配置

[[email protected] ~]# echo 'export PATH=/usr/local/apache/bin:$PATH' > /etc/profile.d/httpd.sh
[[email protected] ~]# source /etc/profile.d/httpd.sh
[[email protected] ~]# ln -s /usr/local/apache/include/ /usr/include/httpd
[[email protected] ~]# echo 'MANPATH /usr/local/apache/man' >> /etc/man.config
           

//取消ServerName前面的注釋

[roo[email protected] ~]# sed -i '/#ServerName/s/#//g' /etc/httpd24/httpd.conf
           

//啟動apache服務

[[email protected] ~]# apachectl start
[[email protected] ~]# ss -antl
State       Recv-Q Send-Q Local Address:Port               Peer Address:Port              
LISTEN      0      128      *:22                   *:*                  
LISTEN      0      100    127.0.0.1:25                   *:*                  
LISTEN      0      128     :::80                  :::*                  
LISTEN      0      128     :::22                  :::*                  
LISTEN      0      100    ::1:25                  :::*                  
           

//在浏覽器上驗證

lamp分離部署+phpmyadmin

mysql伺服器配置

//安裝依賴包

[[email protected] ~]# yum -y install ncurses-devel openssl-devel openssl cmake mariadb-devel
           

//建立使用者群組

[[email protected] ~]# groupadd -r -g 306 mysql
[[email protected] ~]# useradd -M -s /sbin/nologin -g 306 -u 306 mysql
           

//下載下傳二進制格式的mysql軟體包

[[email protected] ~]# cd /usr/src/
[[email protected] src]# ls
debug  kernels
[[email protected] src]# wget https://downloads.mysql.com/archives/get/file/mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
[[email protected] src]# ls
debug  kernels  mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
[[email protected] src]# tar xf mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz -C /usr/local/
[[email protected] src]# cd
[[email protected] ~]# ls /usr/local/
bin  games    lib    libexec                              sbin   src
etc  include  lib64  mysql-5.7.22-linux-glibc2.12-x86_64  share
[[email protected] ~]# cd /usr/local/
[[email protected] local]# ln -sv mysql-5.7.22-linux-glibc2.12-x86_64/ mysql
"mysql" -> "mysql-5.7.22-linux-glibc2.12-x86_64/"
[[email protected] local]# ll
總用量 0
drwxr-xr-x. 2 root root   6 3月  10 2016 bin
drwxr-xr-x. 2 root root   6 3月  10 2016 etc
drwxr-xr-x. 2 root root   6 3月  10 2016 games
drwxr-xr-x. 2 root root   6 3月  10 2016 include
drwxr-xr-x. 2 root root   6 3月  10 2016 lib
drwxr-xr-x. 2 root root   6 3月  10 2016 lib64
drwxr-xr-x. 2 root root   6 3月  10 2016 libexec
lrwxrwxrwx  1 root root  36 8月  10 20:09 mysql -> mysql-5.7.22-linux-glibc2.12-x86_64/
drwxr-xr-x  9 root root 129 8月  10 20:08 mysql-5.7.22-linux-glibc2.12-x86_64
drwxr-xr-x. 2 root root   6 3月  10 2016 sbin
drwxr-xr-x. 5 root root  49 3月  25 02:56 share
drwxr-xr-x. 2 root root   6 3月  10 2016 src
           

//修改目錄/usr/local/mysql的屬主屬組

[[email protected] ~]# chown -R mysql.mysql /usr/local/mysql
[[email protected] ~]# ll /usr/local/mysql -d
lrwxrwxrwx 1 mysql mysql 36 8月  10 20:09 /usr/local/mysql -> mysql-5.7.22-linux-glibc2.12-x86_64/
           

//添加環境變量

[[email protected] ~]# ls /usr/local/mysql
bin  COPYING  docs  include  lib  man  README  share  support-files
[[email protected] ~]# echo 'export PATH=/usr/local/mysql/bin:$PATH' > /etc/profile.d/mysql.sh
[[email protected] ~]# source /etc/profile.d/mysql.sh
[[email protected] ~]# echo $PATH
/usr/local/mysql/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
           

//建立資料存放目錄

[[email protected] ~]# mkdir /opt/data
[[email protected] ~]# chown -R mysql.mysql /opt/data/
[[email protected] ~]# ll /opt/
總用量 0
drwxr-xr-x 2 mysql mysql 6 8月  10 20:16 data
           

//初始化資料庫

[[email protected] ~]# /usr/local/mysql/bin/mysqld --initialize --user=mysql --datadir=/opt/data/
2019-08-10T12:17:29.959505Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-08-10T12:17:30.902297Z 0 [Warning] InnoDB: New log files created, LSN=45790
2019-08-10T12:17:31.051861Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2019-08-10T12:17:31.392858Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: d3ae6f6d-bb68-11e9-82bc-000c2918dd01.
2019-08-10T12:17:31.396859Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2019-08-10T12:17:31.405610Z 1 [Note] A temporary password is generated for [email protected]: hy)n=ek#&6FU
           

//配置mysql

[[email protected] ~]# ln -sv /usr/local/mysql/include/ /usr/local/include/mysql"/usr/local/include/mysql" -> "/usr/local/mysql/include/"
[[email protected] ~]# echo '/usr/local/mysql/lib' > /etc/ld.so.conf.d/mysql.conf
[[email protected] ~]# ldconfig -v
           

//生成配置檔案

[[email protected] ~]# cat > /etc/my.cnf <<EOF
> [mysqld]
> basedir = /usr/local/mysql
> datadir = /opt/data
> socket = /tmp/mysql.sock
> port = 3306
> pid-file = /opt/data/mysql.pid
> user = mysql
> skip-name-resolve
> EOF
           

//配置服務啟動腳本

[[email protected] ~]# cp -a /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
[[email protected] ~]# sed -ri 's#^(basedir=).*#\1/usr/local/mysql#g' /etc/init.d/mysqld
[[email protected] ~]# sed -ri 's#^(datadir=).*#\1/opt/data#g' /etc/init.d/mysqld
           

//啟動mysql

[[email protected] ~]# service mysqld start
Starting MySQL.Logging to '/opt/data/mysql.err'.
. SUCCESS! 
[[email protected] ~]# ps -ef|grep mysql
root      18333      1  0 20:22 pts/0    00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/opt/data --pid-file=/opt/data/mysql.pid
mysql     18511  18333  7 20:22 pts/0    00:00:01 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/opt/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=mysql.err --pid-file=/opt/data/mysql.pid --socket=/tmp/mysql.sock --port=3306
root      18543   1315  0 20:22 pts/0    00:00:00 grep --color=auto mysq
[[email protected] ~]# ss -antl
State       Recv-Q Send-Q Local Address:Port               Peer Address:Port              
LISTEN      0      128      *:22                   *:*                  
LISTEN      0      100    127.0.0.1:25                   *:*                  
LISTEN      0      128     :::22                  :::*                  
LISTEN      0      100    ::1:25                  :::*                  
LISTEN      0      80      :::3306                :::*                  
           

//修改密碼

//使用臨時密碼登入

[[email protected] ~]# mysql -uroot -p'hy)n=ek#&6FU'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.22

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 
           

//設定新密碼

mysql> set password = password('jxy123!');
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> quit
Bye
           

//驗證是否密碼修改成功

[[email protected] ~]# mysql -uroot -p'jxy123!'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.22 MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 
           

php伺服器配置

//關閉防火牆和selinux

[[email protected] ~]# systemctl stop firewalld
[[email protected] ~]# systemctl disable firewalld
[[email protected] ~]# getenforce 
Disabled
           

//配置yum源

[[email protected] ~]# cd /etc/yum.repos.d/
[[email protected] yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
[[email protected] yum.repos.d]# ls
2019.repo  CentOS7-Base-163.repo  redhat.repo
[[email protected] ~]# sed -i 's/\$releasever/7/g' /etc/yum.repos.d/CentOS7-Base-163.repo
[[email protected] ~]# sed -i 's/^enabled=.*/enabled=1/g' /etc/yum.repos.d/CentOS7-Base-163.repo
[[email protected] ~]# yum -y install epel-release
[[email protected] ~]# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
           

//安裝依賴包

[[email protected] ~]# yum -y install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libicu-devel libjpeg libjpeg-devel libpng libpng-devel openldap-devel  libpcre-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel mhash mhash-devel php72w-mysqlnd
           

//下載下傳php

[[email protected] ~]# cd /usr/src/
[[email protected] src]# wget http://cn.php.net/distributions/php-7.2.8.tar.xz
[[email protected] src]# ls
debug  kernels  php-7.2.8.tar.xz
[[email protected] src]# tar xf php-7.2.8.tar.xz 
[[email protected] src]# ls
debug  kernels  php-7.2.8  php-7.2.8.tar.xz
[[email protected] src]# cd php-7.2.8
[[email protected] php-7.2.8]# ./configure --prefix=/usr/local/php7  \
> --with-config-file-path=/etc \
> --enable-fpm \
> --enable-inline-optimization \
> --disable-debug \
> --disable-rpath \
> --enable-shared \
> --enable-soap \
> --with-openssl \
> --enable-bcmath \
> --with-iconv \
> --with-bz2 \
> --enable-calendar \
> --with-curl \
> --enable-exif  \
> --enable-ftp \
> --with-gd \
> --with-jpeg-dir \
> --with-png-dir \
> --with-zlib-dir \
> --with-freetype-dir \
> --with-gettext \
> --enable-json \
> --enable-mbstring \
> --enable-pdo \
> --with-mysqli=mysqlnd \
> --with-pdo-mysql=mysqlnd \
> --with-readline \
> --enable-shmop \
> --enable-simplexml \
> --enable-sockets \
> --enable-zip \
> --enable-mysqlnd-compression-support \
> --with-pear \
> --enable-pcntl \
> --enable-posix
[[email protected] php-7.2.8]# make -j $(cat /proc/cpuinfo |grep processor|wc -l)
[[email protected] php-7.2.8]# make install
           

//安裝後配置

[[email protected] php-7.2.8]# echo 'export PATH=/usr/local/php7/bin:$PATH' > /etc/profile.d/php7.sh
[[email protected] php-7.2.8]# source /etc/profile.d/php7.sh
[[email protected] php-7.2.8]# which php
/usr/local/php7/bin/php
           

//配置php-fpm

[[email protected] php-7.2.8]# cp php.ini-production /etc/php.ini
cp:是否覆寫"/etc/php.ini"? y
[[email protected] php-7.2.8]# cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
[[email protected] php-7.2.8]# chmod +x /etc/rc.d/init.d/php-fpm
[[email protected] php-7.2.8]# cp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.conf
[[email protected] php-7.2.8]# cp /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php-fpm.d/www.conf
           

//編輯php-fpm的配置檔案(/usr/local/php7/etc/php-fpm.conf):

//配置fpm的相關選項為你所需要的值:

include=/usr/local/php7/etc/php-fpm.d/*.conf
//在配置檔案最後一行添加如下
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 2
pm.max_spare_servers = 8
[[email protected] ~]# tail /usr/local/php7/etc/php-fpm.conf
; files from a glob(3) pattern. This directive can be used everywhere in the
; file.
; Relative path can also be used. They will be prefixed by:
;  - the global prefix if it's been set (-p argument)
;  - /usr/local/php7 otherwise
include=/usr/local/php7/etc/php-fpm.d/*.conf
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 2
pm.max_spare_servers = 8
           

//修改php-fpm伺服器上配置檔案,修改監聽位址

[[email protected] ~]# vim /usr/local/php7/etc/php-fpm.d/www.conf
listen = 192.168.93.131:9000  //ip指向自己
listen.allowed_clients = 192.168.93.129  //ip填http的ip位址
           

//啟動php-fpm

[[email protected] ~]# service php-fpm start
Starting php-fpm  done
[[email protected] ~]# ss -antl
State       Recv-Q Send-Q Local Address:Port               Peer Address:Port              
LISTEN      0      128      *:22                   *:*                  
LISTEN      0      100    127.0.0.1:25                   *:*                  
LISTEN      0      128    192.168.93.131:9000                 *:*                  
LISTEN      0      128     :::22                  :::*                  
LISTEN      0      100    ::1:25                  :::*                  
[[email protected] ~]# ps -ef|grep php
root      39527      1  0 21:09 ?        00:00:00 php-fpm: master process (/usr/local/php7/etc/php-fpm.conf)
nobody    39528  39527  0 21:09 ?        00:00:00 php-fpm: pool www
nobody    39529  39527  0 21:09 ?        00:00:00 php-fpm: pool www
nobody    39530  39527  0 21:09 ?        00:00:00 php-fpm: pool www
nobody    39531  39527  0 21:09 ?        00:00:00 php-fpm: pool www
nobody    39532  39527  0 21:09 ?        00:00:00 php-fpm: pool www
root      39540   1414  0 21:10 pts/0    00:00:00 grep --color=auto php
           

在httpd上配置虛拟主機

//編輯httpd.conf檔案,取消以下兩行内容的注釋:

[[email protected] ~]# sed -i '/proxy_module/s/#//g' /etc/httpd24/httpd.conf
[[email protected] ~]# sed -i '/proxy_fcgi_module/s/#//g' /etc/httpd24/httpd.con
           

//建立虛拟主機目錄

[[email protected] ~]# mkdri /usr/local/apache/htdocs/jiangxiuying.com
[[email protected] ~]# mkdir /var/jxy

[[email protected] ~]# vim /etc/httpd24/httpd.conf
//在配置檔案最後一行添加如下:
<VirtualHost *:80>
    DocumentRoot "/usr/local/apache/htdocs/jiangxiuying.com"
    ServerName www.jiangxiuying.com
    ProxyRequests Off
    ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/jiangxiuying.com/$1
    <Directory "jiangxiuying.com">
        Options none
        AllowOverride none
        Require all granted
    </Directory>
</VirtualHost>
           
[[email protected] ~]# vim /etc/httpd24/httpd.conf
//搜尋AddType,添加以下内容
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType application/x-httpd-php .php        
    AddType application/x-httpd-php-source .phps
    
//在index.html前面添加index.php
[[email protected] ~]# sed -i '/    DirectoryIndex/s/index.html/index.php index.html/g' /etc/httpd24/httpd.conf
           

//重新開機apache服務

[[email protected] ~]# apachectl stop
[[email protected] ~]# ss -antl
State       Recv-Q Send-Q Local Address:Port               Peer Address:Port              
LISTEN      0      128      *:22                   *:*                  
LISTEN      0      100    127.0.0.1:25                   *:*                  
LISTEN      0      128     :::22                  :::*                  
LISTEN      0      100    ::1:25                  :::*                  
[[email protected] ~]# apachectl start
[[email protected] ~]# ss -antl
State       Recv-Q Send-Q Local Address:Port               Peer Address:Port              
LISTEN      0      128      *:22                   *:*                  
LISTEN      0      100    127.0.0.1:25                   *:*                  
LISTEN      0      128     :::80                  :::*                  
LISTEN      0      128     :::22                  :::*                  
LISTEN      0      100    ::1:25                  :::*                  
           

//在php上建立index.php檔案

[[email protected] ~]# mkdir /var/jxy
[[email protected] ~]# cd /var/jxy/
[[email protected] jxy]# vim index.php
[[email protected] jxy]# cat index.php 
<?php
   phpinfo();
?>
           

//在浏覽器上驗證

lamp分離部署+phpmyadmin

配置phpmyadmin

//下載下傳phpMyAdmin壓縮包
[[email protected] ~]# wget https://files.phpmyadmin.net/phpMyAdmin/4.0.10.20/phpMyAdmin-4.0.10.20-all-languages.zip
[[email protected] ~]# ls
anaconda-ks.cfg  phpMyAdmin-4.0.10.20-all-languages.zip

//解壓到/var/jxy下
[[email protected] ~]# unzip phpMyAdmin-4.0.10.20-all-languages.zip
[[email protected] ~]# mv phpMyAdmin-4.0.10.20-all-languages /var/jxy/
[[email protected] ~]# ls /var/jxy/
index.php  phpMyAdmin-4.0.10.20-all-languages

//建立軟連結
[[email protected] ~]# cd /var/jxy/
[[email protected] jxy]# ln -sv phpMyAdmin-4.0.10.20-all-languages PMA
"PMA" -> "phpMyAdmin-4.0.10.20-all-languages"
[[email protected] jxy]# ll
總用量 8
-rw-r--r-- 1 root root   23 8月  10 21:24 index.php
drwxr-xr-x 9 root root 4096 3月  28 2017 phpMyAdmin-4.0.10.20-all-languages
lrwxrwxrwx 1 root root   34 8月  10 22:19 PMA -> phpMyAdmin-4.0.10.20-all-languages
[[email protected] jxy]# cd PMA/
[[email protected] PMA]# mv config.sample.inc.php config.inc.php
[[email protected] PMA]# vim config.inc.php 
$cfg['blowfish_secret'] = 'jxy123'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
$cfg['Servers'][$i]['host'] = '192.168.93.130';  //将localhost修改為資料庫的位址

//重新開機php-fpm服務
[[email protected] ~]# service php-fpm restart
Gracefully shutting down php-fpm . done
Starting php-fpm  done
[[email protected] ~]# ss -antl
State       Recv-Q Send-Q Local Address:Port               Peer Address:Port              
LISTEN      0      128      *:22                   *:*                  
LISTEN      0      100    127.0.0.1:25                   *:*                  
LISTEN      0      128    192.168.93.131:9000                 *:*                  
LISTEN      0      128     :::22                  :::*                  
LISTEN      0      100    ::1:25                  :::*                  
           

//在mysql服務端配置

[[email protected] ~]# mysql -uroot -p'jxy123!'
mysql> grant all on *.* to PMA@'192.168.93.%' identified by 'PMApass';
Query OK, 0 rows affected, 1 warning (0.50 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.32 sec)

mysql> 
           

//在http服務端配置

//将反向代理目錄改成php共享的目錄
[[email protected] ~]# vim /etc/httpd24/httpd.conf 
<VirtualHost *:80>
    DocumentRoot "/usr/local/apache/htdocs"
    ServerName www.jiangxiuying.com
    ProxyRequests Off
    ProxyPassMatch ^/(.*\.php)$ fcgi://192.168.93.131:9000/var/jxy/PMA/$1
    <Directory "/var/jxy">
        Options none
        AllowOverride none
        Require all granted
    </Directory>
</VirtualHost>
[[email protected] ~]# mkdir /usr/local/apache/htdocs/pma
[[email protected] ~]# apachectl stop
[[email protected] ~]# apachectl start
[[email protected] ~]# ss -antl
State       Recv-Q Send-Q Local Address:Port               Peer Address:Port              
LISTEN      0      128      *:22                   *:*                  
LISTEN      0      100    127.0.0.1:25                   *:*                  
LISTEN      0      128     :::80                  :::*                  
LISTEN      0      128     :::22                  :::*                  
LISTEN      0      100    ::1:25                  :::*                  
           

//驗證

lamp分離部署+phpmyadmin

繼續閱讀