基于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
基于lamp搭建wordpress
8.创建一个单独的用户
基于lamp搭建wordpress
9.部署wordpress
(1)把安装包移动到 /var/www/html下


[[email protected]st ~]# cp wordpress-5.0.3-zh_CN/wordpress/* /var/www/html/ -rf


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

[[email protected] html]# cp wp-config-sample.php wp-config.php

[[email protected] 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
基于lamp搭建wordpress
接下来 就可以登陆了

基于lamp搭建wordpress
基于lamp搭建wordpress