Linux小课堂开课了(10)-centos 7.3搭建wordpress

centos 7.3搭建wordpress

1、先安装apache
[root@localhost ~]# yum -y install httpd
[root@localhost ~]# systemctl restart httpd
[root@localhost ~]# systemctl enable httpd
[root@localhost ~]# firewall-cmd --permanent --add-service=http
[root@localhost ~]# firewall-cmd –reload
打开浏览器测试

2、安装MariaDB数据库
[root@localhost ~]# yum -y install mariadb-server mariadb
[root@localhost ~]# systemctl restart mariadb
[root@localhost ~]# systemctl enable mariadb
对数据库进行设置
[root@localhost ~]# mysql_secure_installation
提示输入数据库密码,第一个先回车,接下来设置密码

接下来默认选y至结束

3、安装php
特别注意,用yum install -y php php-mysql安装的php版本是php5.4,而安装wordpress是需要php5.6,所以换一个方法进行安装
先安装php软件yun库
[root@localhost ~]# rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
[root@localhost ~]# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
安装php5.6
[root@localhost ~]# yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd php56w-mysql php56w-intl php56w-mbstring


重启一下apache服务
root@localhost ~]# systemctl restart httpd
测试一下php
[root@localhost ~]# vim /var/www/html/info.php
phpinfo();
?>
打开浏览器测试一下

4、安装phpMyAdmin
先安装epel
[root@localhost ~]# yum install -y epel-release,再安装phpMyAdmin
[root@localhost ~]# yum -y install phpmyadmin

phpMyAdmin的httpd设置,配置文件为/etc/httpd/conf.d/phpMyAdmin.conf
[root@localhost ~]# vim /etc/httpd/conf.d/phpMyAdmin.conf

修改后如图

Wq保存好后重启apache服务
[root@localhost ~]# systemctl restart httpd
打开浏览器测试

5、创建wordpress数据库
登录数据库
[root@localhost ~]# mysql -u root –p
创建数据库
MariaDB [(none)]> CREATE DATABASE wordpress;
设置数据库用户名与密码
MariaDB [(none)]> CREATE USER wordpressuser@localhost IDENTIFIED BY 'wordress_password';
设置wordpressuser访问wordpress数据库权限
MariaDB [(none)]> GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'wordress_password';

刷新数据库设置
MariaDB [(none)]> FLUSH PRIVILEGES;

6、安装wordpress
[root@localhost ~]# cd /var/www/html/
[root@localhost html]# mkdir opt
[root@localhost html]# mkdir wordpress
[root@localhost html]# cd opt
[root@localhost opt]# wget https://cn.wordpress.org/wordpress-4.9.1-zh_CN.tar.gz
[root@localhost opt]# tar xzvf wordpress-4.9.1-zh_CN.tar.gz -C /var/www/html/wordpress/
[root@localhost opt# cd /var/www/html/wordpress/wordpress/
[root@localhost wordpress]# cp wp-config-sample.php wp-config.php
编辑wp-config.php
[root@localhost wordpress]# vim wp-config.php

打开浏览器

输入http://192.168.11.137/wordpress/wordpress/wp-admin/install.php





此刻,centos 7.3搭建wordpress完成。

未完,待续~

你可能感兴趣的:(Linux小课堂开课了(10)-centos 7.3搭建wordpress)