基于lamp搭建wordpress

一.准备工作
安装环境 : centos 7.4
下载安装包 :这儿下载中文版本

https://cn.wordpress.org/download/releases/

二.开始安装软件和所需要的依赖包

1.因为本机自带的镜像的依赖包 不够 所以 我们配置 一个epel
源 和一个base 源。

[epel]
name=epel
baseurl=https://mirrors.aliyun.com/epel/7Server/x86_64/
gpgcheck=0
enabled=1


wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

2.接下来安装 软件包。

yum install arp* -y
yum install php -y
yum install mariadb* -y  数据库的安装
yum install phpMyAdmin -y
yum install httpd -y

3.启动 数据库

systemctl start mariadb

mysql_secure_installation 初始化密码  默认都是 y

4.启动htttpd服务

systemctl start httpd

5.修改配置文件

vi /etc/httpd/conf.d/phpMyAdmin.conf

17行 和34 行 修改 为

192.168.137.0/24 #修改规则

重启httpd 服务

systemctl restart httpd

6.进去php数据库管理页面 配置

http://192.168.137.132/phpmyadmin/

7.创建数据库 名为wpdb
在这里插入图片描述
8.创建一个单独的用户
在这里插入图片描述
9.部署wordpress
(1)把安装包移动到 /var/www/html下


[root@localhost ~]# cp wordpress-5.0.3-zh_CN/wordpress/* /var/www/html/ -rf


(2)准备WordPress的配置文件 wp-config.php

[root@localhost html]# cp wp-config-sample.php wp-config.php

[root@localhost html]# vi wp-config.php


// ** MySQL 设置 - 具体信息来自您正在使用的主机 ** //
/** WordPress数据库的名称 */
define('DB_NAME', 'wpdb');

/** MySQL数据库用户名 */
define('DB_USER', 'cwf');

/** MySQL数据库密码 */
define('DB_PASSWORD', '123456');

/** MySQL主机 */
define('DB_HOST', 'localhost');

/** 创建数据表时默认的文字编码 */
define('DB_CHARSET', 'utf8');

/** 数据库整理类型。如不确定请勿更改 */
define('DB_COLLATE', '');

(3)开始安装
浏览器输入 http://192.168.137.132/wp-admin/install.php
在这里插入图片描述
接下来 就可以登陆了

在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值