LAMP架构

LAMP动态网站部署架构是由一套 Linux+Nginx/Apache+MySQL+PHP 组成的动态网站系统解决方案。

部署过程

  1. 安装Apache和放行防火墙

    1. [root@localhost ~]# yum install httpd wget unzip -y
    2. [root@localhost ~]# systemctl start httpd
    3. [root@localhost ~]# systemctl enable httpd
    4. [root@localhost ~]# firewall-cmd --add-port=80/tcp --permanent
    5. success
    6. [root@localhost ~]# firewall-cmd --reload
    7. success
  2. 安装PHP

    1. [root@localhost ~]# yum install php-* --skip-broken php-mysqlnd
    2. [root@localhost ~]# cd /var/www/html
    3. [root@localhost html]# wget http://mirrors.eagleslab.com:8889/tz.php # 安装PHP探针
    4. [root@localhost html]# systemctl restart httpd

    访问192.168.80.132/tz.php
    %18Z4X[%%B9BP{0]7`YA4ZB.png

  3. 安装mariadb

    1. [root@localhost ~]# yum install mariadb mariadb-server -y
    2. [root@localhost ~]# systemctl start mariadb
    3. [root@localhost ~]# systemctl enable mariadb
    4. [root@localhost ~]# mysql_secure_installation

    测试数据库连接情况
    @11}FDW_0CK)FFF8W}[C@LW.png](https://cdn.nlark.com/yuque/0/2021/png/614741/1615095250529-6c490286-54c9-46ea-815b-41c1d1c5646a.png#align=left&display=inline&height=94&margin=%5Bobject%20Object%5D&name=%4011%7DFDW_0CK%29FFF8W%7D%5BC%40LW.png&originHeight=94&originWidth=1212&size=19725&status=done&style=none&width=1212)<br />![MDL_XW$@PYB%I13]A_9UM6P.png
    4.创建用于博客网站的数据库

    1. [root@localhost ~]# mysql -uroot -p1 -e "create database blog;show databases;"
    2. +--------------------+
    3. | Database |
    4. +--------------------+
    5. | information_schema |
    6. | blog |
    7. | mysql |
    8. | performance_schema |
    9. +--------------------+
  4. 下载安装博客源码(typecho官网)

    1. [root@localhost ~]# cd /var/www/html
    2. [root@localhost html]# wget http://typecho.org/downloads/1.1-17.10.30-release.tar.gz
    3. [root@localhost html]# tar -zxvf 1.1-17.10.30-release.tar.gz

    这里发现解压到了一个build文件夹下,访问的时候注意加上/build。也可以指定解压到当前目录。
    ![XIGSQ57$A]EJ)@LKH{1ERR.png
    ![RMRK(D_$K9EK46Z(~Z@5.png