LAMP/Linux CMS 网站快速搭建

LAMP

概述

  • LAMP
    • Linux
    • Apache httpd
    • MySQL
    • PHP

LAMP 部署

部署 Apache

安装 PHP

  • 安装命令

    # 安装主程序和两个扩展
    yum install php php-mysql php-mbstring -y
    

    image-20231010150905390

  • 验证

    php -v
    

    image-20231010150927984

  • 执行 PHP 代码

    php -r "php语句;"
    

部署 CMS(low)

  • 解压安装 CMS
    提取码:gz65

  • 解压

    unzip cms.zip
    

    image-20231010151249385

  • 移动至 Apache Web 根目录

    mv cms /var/www/html/
    
  • 切换到 Client 访问 Server 172.16.1.100/cms

    显示需要数据库密码

    image-20231010163108169

  • Server 数据库交互配置,添加密码

    vim /var/www/html/cms/include/database.inc.php 
    

    image-20231010163312051

  • 回到 Client,刷新页面

    提示没有数据库 cms

    image-20231010163349878

  • 新建 CMS 数据库

    mysql -uroot -proot
    create database cms;
    

    image-20231010163507100

  • 回到 Client 刷新页面

    提示没有所需要的表

    image-20231010163639191

  • 回到 Server 导入数据库表

    use cms;
    source /var/www/html/cms/install.sql;
    

    image-20231010163743839

  • 切换到 Client,可以看到部署成功

    image-20231010163833313

部署 Metinfo(nb)

  • metinfo 下载
    提取码:49g7

  • 创建文件夹 metinfo

    在文件夹内解压 metinfo_6.0.0

    mkdir metinfo
    mv MetInfo6.0.0.zip metinfo/
    cd metinfo
    unzip MetInfo6.0.0.zip
    

    image-20231010153104342

  • 将文件移入 /var/www/html/ 下

    mv /root/Desktop/metinfo /var/www/html/
    
  • 切换到 Client 访问 Server 172.16.1.100/metinfo

    提示权限不够

    image-20231010164105084

  • 回到 Server 赋权

    chmod -R 777 /var/www/html/metinfo/
    

    image-20231010164214636

  • 切换到 Client 刷新页面

    提示没有 gd 模块

    image-20231010164259441

  • 回到 Server 安装 gd 模块

    yum install php-gd.x86_64
    

    image-20231010165759439

    重启 apache 服务

    systemctl restart httpd.service
    
  • 切换到 Client 刷新页面

    image-20231010170349609

  • 点击下一步

    填写数据库名及密码

    image-20231010171530901

  • 填写管理员信息

    image-20231010171644613

    image-20231010171654820

  • 成功进入网站

    image-20231010171714196

删除 httpd 默认网页

  • 删除默认网页,直接访问 html 目录

    vim /etc/httpd/conf.d/welcome.conf
    # 注释掉第 9.10 行
    
    #重启 apache 服务
    systemctl restart httpd.service
    

    image-20231010150652547

  • 修改前

    image-20231010173148781

    修改后

    image-20231010173038230

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

gjl_

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值