部署LAMP之WordPress, PMA(https), Discuz

一、环境介绍

系统:CentOS 6.7

软件:httpd-2.2, mysql-5.3, wordpress-4.3, pma4.0

网络:

pma.anyisalin.com部署MySQL, Bind, PMA, IP地址为192.168.2.6

wp.anyisalin.com部署WordPress并且为私有CA, IP地址为192.168.2.7

dz.anyisalin.com部署Discuz, IP地址为192.168.2.8

SELinux和iptables均为关闭

wp和dz主机的DNS地址指向pma主机

涉及知识点:httpd配置, httpd中https配置, openssl, bind, mysql基础知识, php安装...

声明:本文只介绍配置, 理论知识不进行说明

二、部署Bind和MySQL

我们在pma主机上配置bind, 如果不会bind的查看我的文章DNS and BIND配置指南

[[email protected] ~]# yum install bind bind-utils httpd mysql-server php-mysql  php-mbstring mod_ssl  #使用yum安装相关软件
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
Resolving Dependencies

            # 中间内容过长省略

Installed:
  bind.x86_64 32:9.8.2-0.37.rc1.el6           bind-utils.x86_64 32:9.8.2-0.37.rc1.el6           httpd.x86_64 0:2.2.15-45.el6.centos           mysql-server.x86_64 0:5.1.73-5.el6_6          

Dependency Installed:
  apr.x86_64 0:1.3.9-5.el6_2    apr-util.x86_64 0:1.3.9-3.el6_0.1 apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 bind-libs.x86_64 32:9.8.2-0.37.rc1.el6 httpd-tools.x86_64 0:2.2.15-45.el6.centos
  mailcap.noarch 0:2.1.31-2.el6 mysql.x86_64 0:5.1.73-5.el6_6     perl-DBD-MySQL.x86_64 0:4.013-3.el6    perl-DBI.x86_64 0:1.609-4.el6          portreserve.x86_64 0:0.0.4-9.el6         

Complete!

使用Bind配置DNS服务器达到效果如下

[[email protected] named]# host -t A pma.anyisalin.com 192.168.2.6
Using domain server:
Name: 192.168.2.6
Address: 192.168.2.6#53
Aliases: 
pma.anyisalin.com has address 192.168.192.6
[[email protected] named]# host -t A wp.anyisalin.com 192.168.2.6
Using domain server:
Name: 192.168.2.6
Address: 192.168.2.6#53
Aliases: 
wp.anyisalin.com has address 192.168.192.7
[[email protected] named]# host -t A dz.anyisalin.com 192.168.2.6
Using domain server:
Name: 192.168.2.6
Address: 192.168.2.6#53
Aliases: 
dz.anyisalin.com has address 192.168.192.8

创建数据库和相应用户并赋予权限

[[email protected] named]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, 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> GRANT ALL ON wpdb.* TO ‘wpuser‘@‘%‘ IDENTIFIED BY ‘passwd‘;    #赋予wpuser用户对wpdb数据库的所有权限, 并设置密码为passwd
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL ON dzdb.* TO ‘dzuser‘@‘%‘ IDENTIFIED BY ‘passwd‘;    #赋予dzuser用户对dzdb数据库的所有权限, 并设置密码为passwd
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE DATABASE wpdb;                #创建wpdb数据库
Query OK, 1 row affected (0.00 sec)

mysql> CREATE DATABASE dzdb;                #创建dzdb数据库
Query OK, 1 row affected (0.00 sec)

三、部署WordPress

[[email protected] ~]# yum install httpd php php-mysql -y    #安装相应软件
Loaded plugins: fastestmirror
Setting up Install Process
Determining fastest mirrors
anyisalin                                                                                                                                                             | 4.0 kB     00:00 ... 
anyisalin/primary_db                                                                                                                                                  | 4.6 MB     00:00 ... 
Resolving Dependencies
--> Running transaction check

              #过程太长, 中间省略
                                                                                                                  12/12 

Installed:
  httpd.x86_64 0:2.2.15-45.el6.centos                               php.x86_64 0:5.3.3-40.el6_6                               php-mysql.x86_64 0:5.3.3-40.el6_6                              

Dependency Installed:
  apr.x86_64 0:1.3.9-5.el6_2    apr-util.x86_64 0:1.3.9-3.el6_0.1 apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 httpd-tools.x86_64 0:2.2.15-45.el6.centos libedit.x86_64 0:2.11-4.20080712cvs.1.el6
  mailcap.noarch 0:2.1.31-2.el6 php-cli.x86_64 0:5.3.3-40.el6_6   php-common.x86_64 0:5.3.3-40.el6_6     php-pdo.x86_64 0:5.3.3-40.el6_6          

Complete!

配置虚拟主机

[[email protected] ~]# vim /etc/httpd/conf.d/wp.conf
#配置如下

NameVirtualHost 192.168.2.7:80
<VirtualHost *:80>
    ServerName wp.anyisalin.com
    DocumentRoot /var/www/wp/
</VirtualHost>

下载WordPress

[[email protected] ~]# wget -O /var/www/wp/wordpress.zip https://cn.wordpress.org/wordpress-4.4.2-zh_CN.zip     # 下载wordpress到指定目录
--2016-03-23 17:26:22--  https://cn.wordpress.org/wordpress-4.4.2-zh_CN.zip
Resolving cn.wordpress.org... 66.155.40.249, 66.155.40.250
Connecting to cn.wordpress.org|66.155.40.249|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8168125 (7.8M) [application/zip]
Saving to: “/var/www/wp/wordpress.zip”

100%[===================================================================================================================================================>] 8,168,125    277K/s   in 43s     

2016-03-23 17:27:06 (187 KB/s) - “/var/www/wp/wordpress.zip” saved [8168125/8168125]

[[email protected] ~]#

配置WordPress

[[email protected] wp]# unzip wordpress.zip     #解压缩wordpress安装包

inflating: wordpress/wp-content/themes/twentysixteen/search.php  
  inflating: wordpress/wp-content/themes/twentysixteen/searchform.php  
  inflating: wordpress/wp-content/themes/twentysixteen/page.php  
   creating: wordpress/wp-content/themes/twentysixteen/template-parts/

       #过程省略
       
  inflating: wordpress/wp-signup.php  
  inflating: wordpress/readme.html   
  inflating: wordpress/wp-config-sample.php  
  inflating: wordpress/wp-blog-header.php  
  inflating: wordpress/wp-links-opml.php  

[[email protected] wp]# cd wordpress    #进入安装目录

[[email protected] wordpress]# cp wp-config-sample.php wp-config.php    #复制其配置模板然后配置

[[email protected] wordpress]# vim wp-config.php    #按自己的参数进行配置
/** WordPress数据库的名称 */
define(‘DB_NAME‘, ‘wpdb‘);

/** MySQL数据库用户名 */
define(‘DB_USER‘, ‘wpuser‘);

/** MySQL数据库密码 */
define(‘DB_PASSWORD‘, ‘passwd‘);

/** MySQL主机 */
define(‘DB_HOST‘, ‘192.168.2.6‘);

[[email protected] wordpress]# service httpd restart    #重启httpd 服务
Stopping httpd:                                            [FAILED]
Starting httpd: 

httpd: Could not reliably determine the server‘s fully qualified domain name, using wp.anyisalin.com for ServerName
[Wed Mar 23 17:32:51 2016] [warn] NameVirtualHost 192.168.2.7:80 has no VirtualHosts
                                                           [  OK  ]
[[email protected] wordpress]# ln -sv wp wordpress.zip

测试WordPress

如果想查看详细安装过程, 请看我以前写的博客 CentOS/RHEL6.5中使用WordPress快速建站

四、部署Discuz

[[email protected] ~]# yum install httpd php php-mysql -y    #安装相应软件
Loaded plugins: fastestmirror
Setting up Install Process
Determining fastest mirrors
anyisalin                                                                                                                                                             | 4.0 kB     00:00 ... 
anyisalin/primary_db                                                                                                                                                  | 4.6 MB     00:00 ... 
Resolving Dependencies
--> Running transaction check

              #过程太长, 中间省略
                                                                                                                  12/12 

Installed:
  httpd.x86_64 0:2.2.15-45.el6.centos                               php.x86_64 0:5.3.3-40.el6_6                               php-mysql.x86_64 0:5.3.3-40.el6_6                              

Dependency Installed:
  apr.x86_64 0:1.3.9-5.el6_2    apr-util.x86_64 0:1.3.9-3.el6_0.1 apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 httpd-tools.x86_64 0:2.2.15-45.el6.centos libedit.x86_64 0:2.11-4.20080712cvs.1.el6
  mailcap.noarch 0:2.1.31-2.el6 php-cli.x86_64 0:5.3.3-40.el6_6   php-common.x86_64 0:5.3.3-40.el6_6     php-pdo.x86_64 0:5.3.3-40.el6_6          

Complete!

配置虚拟主机

[[email protected] ~]# vim /etc/httpd/conf.d/wp.conf
#配置如下

NameVirtualHost 192.168.2.7:80
<VirtualHost *:80>
    ServerName dz.anyisalin.com
    DocumentRoot /var/www/dz
</VirtualHost>

下载Discuz

[[email protected] ~]# wget -O /var/www/dz/dz.zip http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_UTF8.zip    #下载discuz到相应目录
--2016-03-24 04:54:19--  http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_UTF8.zip
Resolving download.comsenz.com... 101.227.130.115
Connecting to download.comsenz.com|101.227.130.115|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12486177 (12M) [application/zip]
Saving to: “/var/www/dz/dz.zip”

100%[===================================================================================================================================================>] 12,486,177  7.65M/s   in 1.6s    

2016-03-24 04:54:21 (7.65 MB/s) - “/var/www/dz/dz.zip” saved [12486177/12486177]

[[email protected] ~]# cd /var/www/dz/
[[email protected] ~]# unzip dz.zip 
  inflating: utility/convert/source/uch2.0_x2.0/table/home_blogfield.php  
  inflating: utility/convert/source/uch2.0_x2.0/table/home_class.php  
  inflating: utility/convert/source/uch2.0_x2.0/table/home_click.php  
  inflating: utility/convert/source/uch2.0_x2.0/table/home_clickuser.php  
  inflating: utility/convert/source/uch2.0_x2.0/table/home_comment.php  
        #过程过长省略
  inflating: utility/oldprg/uchome/space.php  
  inflating: utility/restore.php     
  inflating: utility/update.php   

[[email protected] upload]# service httpd restart    #重启httpd服务
Stopping httpd:                                            [  OK  ]
Starting httpd: httpd: Could not reliably determine the server‘s fully qualified domain name, using dz.anyisalin.com for ServerName
[Thu Mar 24 04:59:26 2016] [warn] NameVirtualHost 192.168.2.8:80 has no VirtualHosts
                                                           [  OK  ]
[[email protected] ]# cd upload
[[email protected] upload]# chmod 777 * -R    #待会要用

配置Discuz(通过网页配置)

输入此URL进入安装界面

五、部署PMA

现在我们的Application 都已经搭建好了,由于我们的数据都在pma主机的数据库上,是非常便于管理的,我们可以通过安装phpMyAdmin去管理

配置虚拟主机(软件我们一开始已经安装过了)

[[email protected] ~]# vim /etc/httpd/conf.d/virt.conf

NameVirtualHost 192.168.2.6:80

<VirtualHost *:80>
  ServerName pma.anyisalin.com
  DocumentRoot /var/www/pma
</VirtualHost>

下载PhpMyAdmin(由于我的MySQL版本太低, 所以用phpMyAdmin-4.0的

[[email protected] www]# wget https://files.phpmyadmin.net/phpMyAdmin/4.0.10.15/phpMyAdmin-4.0.10.15-english.zip
--2016-03-23 18:23:48--  https://files.phpmyadmin.net/phpMyAdmin/4.0.10.15/phpMyAdmin-4.0.10.15-english.zip
Resolving files.phpmyadmin.net... 
61.191.206.4
Connecting to files.phpmyadmin.net|61.191.206.4|:443... failed: Connection refused.
[[email protected] www]# 
[[email protected] www]# wget https://files.phpmyadmin.net/phpMyAdmin/4.0.10.15/phpMyAdmin-4.0.10.15-english.zip
--2016-03-23 18:24:12--  https://files.phpmyadmin.net/phpMyAdmin/4.0.10.15/phpMyAdmin-4.0.10.15-english.zip
Resolving files.phpmyadmin.net... 37.235.108.9
Connecting to files.phpmyadmin.net|37.235.108.9|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4923535 (4.7M) [application/zip]
Saving to: “phpMyAdmin-4.0.10.15-english.zip”

100%[===================================================================================================================================================>] 4,923,535   45.4K/s   in 3m 59s  

2016-03-23 18:28:13 (20.1 KB/s) - “phpMyAdmin-4.0.10.15-english.zip” saved [4923535/4923535]

[[email protected] www]# unzip phpMyAdmin-4.0.10.15-english    #解压
  inflating: phpMyAdmin-4.0.10.15-english/js/sql.js  
  inflating: phpMyAdmin-4.0.10.15-english/js/tbl_change.js  
  inflating: phpMyAdmin-4.0.10.15-english/js/tbl_chart.js  
  inflating: phpMyAdmin-4.0.10.15-english/js/tbl_gis_visualization.js  
  inflating: phpMyAdmin-4.0.10.15-english/js/tbl_relation.js  
  
      #过程太长,省略
  inflating: phpMyAdmin-4.0.10.15-english/js/tbl_select.js  
  inflating: phpMyAdmin-4.0.10.15-english/js/tbl_structure.js  
  inflating: phpMyAdmin-4.0.10.15-english/js/tbl_zoom_plot_jqplot.js  
  inflating: phpMyAdmin-4.0.10.15-english/js/whitelist.php  
   creating: phpMyAdmin-4.0.10.15-english/libraries/
  inflating: phpMyAdmin-4.0.10.15-english/libraries/Advisor.class.php  
  inflating: phpMyAdmin-4.0.10.15-english/libraries/Config.class.php  
  inflating: phpMyAdmin-4.0.10.15-english/libraries/DBQbe.class.php  
  inflating: phpMyAdmin-4.0.10.15-english/libraries/DbSearch.class.php  
  inflating: phpMyAdmin-4.0.10.15-english/libraries/DisplayResults.class.php  
  inflating: phpMyAdmin-4.0.10.15-english/libraries/Error.class.php  
  inflating: phpMyAdmin-4.0.10.15-english/libraries/Error_Handler.class.php  
  
[[email protected] www]# ln -sv  phpMyAdmin-4.0.10.15-english  pma    #建立软链接
`pma‘ -> `phpMyAdmin-4.0.10.15-english‘

[[email protected] www]# service httpd restart    #重启httpd服务
Stopping httpd:                                            [FAILED]
Starting httpd: httpd: Could not reliably determine the server‘s fully qualified domain name, using pma.anyisalin.com for ServerName
[Wed Mar 23 18:32:02 2016] [warn] NameVirtualHost 192.168.2.6:80 has no VirtualHosts
                                                           [  OK  ]
[[email protected] www]#

测试(一定要安装php-mbstring)

六、部署PMA为https

由于我们的数据库安全至关重要,所以要对pma.anyisalin.com进行加密

将wp主机建立成私有CA

[[email protected] CA]# (umask 077; openssl genrsa -out private/cakey.pem 2048)
Generating RSA private key, 2048 bit long modulus
...............................................................................................+++
......+++
e is 65537 (0x10001)
[[email protected] CA]# openssl req -new -x509 -key private/cakey.pem  -out cacert.pem -days 7300
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.‘, the field will be left blank.
-----
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:HeFei
Locality Name (eg, city) [Default City]:HeFei
Organization Name (eg, company) [Default Company Ltd]:AnyISalIn
Organizational Unit Name (eg, section) []:OPS
Common Name (eg, your name or your server‘s hostname) []:wp.anyisalin.com
Email Address []:mail.anyisalin.com
[[email protected] CA]# touch index.txt
[[email protected] CA]# echo 01 > serial

PMA主机生成私钥和证书

[[email protected] certs]# cd /etc/httpd/
[[email protected] httpd]# mkdir certs/
[[email protected] httpd]# cd certs/
[[email protected] certs]# (umask 077; openssl genrsa -out httpd.key 1024)
Generating RSA private key, 1024 bit long modulus
.......................................++++++
.......................................................................................++++++
e is 65537 (0x10001)
[[email protected] certs]# openssl req -new  -key httpd.key -out http.csr -days 365
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.‘, the field will be left blank.
-----
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:HeFei
Locality Name (eg, city) [Default City]:HeFei
Organization Name (eg, company) [Default Company Ltd]:AnyISalIn
Organizational Unit Name (eg, section) []:OPS
Common Name (eg, your name or your server‘s hostname) []:pma.anyisalin.com
Email Address []:mail.anyisalin.com

Please enter the following ‘extra‘ attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
[[email protected] certs]# scp http.csr 192.168.2.7:/etc/pki/CA
The authenticity of host ‘192.168.2.7 (192.168.2.7)‘ can‘t be established.
RSA key fingerprint is af:4e:d8:d7:41:04:f4:3a:66:ba:ca:b4:b0:c0:86:e8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.2.7‘ (RSA) to the list of known hosts.
[email protected]‘s password: 
http.csr                                                                                                                                                   100%  704     0.7KB/s   00:00    
[[email protected] certs]#

wp主机签署证书

[[email protected] CA]#  openssl ca -in http.csr -out certs/httpd.crt
Using configuration from /etc/pki/tls/openssl.cnf
Check that the request matches the signature
Signature ok
Certificate Details:
        Serial Number: 1 (0x1)
        Validity
            Not Before: Mar 23 22:54:29 2016 GMT
            Not After : Mar 23 22:54:29 2017 GMT
        Subject:
            countryName               = CN
            stateOrProvinceName       = HeFei
            organizationName          = AnyISalIn
            organizationalUnitName    = OPS
            commonName                = pma.anyisalin.com
            emailAddress              = mail.anyisalin.com
        X509v3 extensions:
            X509v3 Basic Constraints: 
                CA:FALSE
            Netscape Comment: 
                OpenSSL Generated Certificate
            X509v3 Subject Key Identifier: 
                F0:B1:A8:2E:36:72:E5:D9:F7:20:22:61:67:49:29:63:7E:3E:37:24
            X509v3 Authority Key Identifier: 
                keyid:BE:1B:E0:D0:B5:54:12:22:99:68:03:9D:BA:7A:01:E9:A4:AD:ED:5B

Certificate is to be certified until Mar 23 22:54:29 2017 GMT (365 days)
Sign the certificate? [y/n]:y

1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated
[[email protected] CA]# scp certs/httpd.crt 192.168.2.6:/etc/httpd/certs
The authenticity of host ‘192.168.2.6 (192.168.2.6)‘ can‘t be established.
RSA key fingerprint is af:4e:d8:d7:41:04:f4:3a:66:ba:ca:b4:b0:c0:86:e8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.2.6‘ (RSA) to the list of known hosts.
[email protected]‘s password: 
httpd.crt                                                                                                                                                  100% 3879     3.8KB/s   00:00    
[[email protected] CA]#

配置PMA主机支持SSL

mod_ssl软件开始已经安装过,我们直接修改虚拟主机配置文件

[[email protected] certs]# vim /etc/httpd/conf.d/virt.conf    #必须注释/etc/httpd/conf/httpd.conf中DocumentRoot
 Listen 443
<VirtualHost 192.168.2.6:443>
  ServerName pma.anyisalin.com
  DocumentRoot /var/www/pma
  SSLengine ON
  SSLprotocol ALL -sslv2 -sslv3
  SSLcertificatefile /etc/httpd/certs/httpd.crt
  SSLcertificatekeyfile /etc/httpd/certs/httpd.key
</VirtualHost>

[[email protected] conf.d]# service httpd start    #启动httpd
Starting httpd: [Wed Mar 23 19:21:39 2016] [warn] _default_ VirtualHost overlap on port 443, the first has precedence
[Wed Mar 23 19:21:39 2016] [warn] NameVirtualHost 192.168.2.6:443 has no VirtualHosts
                                                           [  OK  ]

测试

导入CA证书

刷新页面

七、总结

总结了近两天所学的知识,能够熟悉的在LAMP环境下部署Web Application,并且简单的使用MySQL,还是很有收获的,但是在https配置上还有点不熟,还有待提高。

作者:AnyISalIn

QQ:1449472454; 欢迎大家加QQ交流

时间: 2024-08-12 14:00:27

部署LAMP之WordPress, PMA(https), Discuz的相关文章

单台主机一键编译部署LAMP+wordpress+discuz系统的shell脚本

单台主机一键编译部署LAMP+wordpress+discuz系统的shell脚本 ? 说明: 1.shell脚本与应用程序包在同一个目录中: 2.虚拟机尽量加大CPU核数,以提高编译速度: 3.根据需要修改相应的变量,主要是安装目录.用户名.密码: 4.Mariadb的grant授权部分,需要先手动修改授权范围(@后面的内容)和密码: 5.httpd与php采用sock通讯. ? 完整的shell脚本 #!/bin/bash #*********************************

CentOS7部署LAMP之phpMyAdmin、wordpress、Discuz

在CentOS7使用yum安装httpd.mariadb以及php.并且部署phpMyAdmin.wordpress.Discuz这三个服务. 虚拟主机名称为: pma.lcs.com,安装phpMyAdmin wp.lcs.com,安装wordpress dz.lcs.com,安装Discuz httpd.mariadb服务器主机IP地址为172.16.125.128,DNS服务器的IP地址为172.16.125.125,用于测试的主机IP地址为172.16.125.129. 安装详细步骤:

一台centos7主机部署LAMP,提供https服务

在一台centos7上部署LAMP以及xcache并安装分别在2个虚拟主机上部署wordpress和php-myadmin且为phpmyadmin提供https服务: #用rpm包快速部署 :LAMP 1.yum安装: yum  install  -y      httpd   php    php-mysql  php-gd   php-mbstring   php-xml    mariadb-server  mod_ssl Installed: httpd.x86_64 0:2.4.6-4

在同一主机上基于编译实现lamp并构建虚拟机使用pma和discuz

在同一主机上基于编译实现lamp并构建虚拟机使用pma和discuz 目的: ①通过手动编译方式,在linux系统上安装apache http2.4,mariadb,php构建lamp;其中php与http的结合方式需要构建两种:1.php以http模块方式安装:2.php以独立守护进程方式安装 : ②在上面构建的lamp基础上设置两个虚拟机,分别使用安装phpMyAdmin和discuz 第一部分:模块话php安装lamp 一.准备工作 (一).查询有没有安装过amp的程序包: [[email

编译部署LAMP+xcache (php-fpm模式)

通过编译安装方式部署分离式LAMP+xcache (php-fpm模式) 要求: (1)采用源码编译部署分离式的LAMP,其中php基于php-fpm模式 (2)基于LAMP平台一个虚拟主机提供WordPress,另一个虚拟主机提供phpMyadmin (3)利用xcache来为php提供缓存加速页面的访问速度 (4)对其中一个站点缓分别做压力测试,并且比对缓存加速前和加速后的数据. 环境: 192.168.1.103------>提供httpd服务 192.168.1.104------>提

分布式部署LAMP

分主机部署lamp httpd主机:192.168.152.140 php-fpm主机:192.168.152.141 mariadb主机:192.168.152.142 httpd yum -y install httpd vim /etc/httpd/conf.d/vhosts.conf AddType application/x-httpd-php .php DirectoryIndex index.php index.html <VirtualHost *:80>     Server

基于模块类型php部署LAMP

前言: L:Linux A:Apache M:MariaDB P:PHP 当我们要基于模块PHP去部署LAMP时,需要在两台主机上进行操作,一台主机提供http以及php,另一台主机提供MariDB. 本博客就基于模块类型的PHP部署两台服务器的LAMP: 如图所示:我们要基于此种模型进行部署: 第一部分: 首先我们要准备两台Linux(CentOS7)主机:一台主机作为HTTP/PHP主机: 第一步:(部署httpd/php) eno16777736: flags=4163<UP,BROADC

centos7部署LAMP+xcache (php fpm模式)

centos7通过RPM包部署分离式LAMP+xcache (php-fpm) 要求: rpm包部署LAMP,并且需要将LAMP环境进行分离式的部署 (1)一个虚拟主机提供wordpress 一个虚拟主机提供phpMyadmin (2)利用xcache来加速页面速度 环境: 此处用三台主机分别分离提供不同服务: 192.168.1.104------->提供httpd服务 192.168.1.110------->提供mariadb-server服务 192.168.1.113-------&

三台主机分别部署LAMP

要求:httpd, php, mariadb分别部署在一个单独的主机上,一个虚拟主机提供phpMyAdmin,另一个虚拟主机提供wordpress,为phpMyAdmim提供https服务: 一. 分工三台主机 A  httpd主机   172.16.35.1 B  php-fpm主机 172.16.35.2 C  mariadb主机 172.16.35.3 为方便实验在这里关闭防火墙 #iptables-F #setenforce0 安装所需rpm包: 在A上yum -y install ht