搭建博客wordpress --- LAMP

contos 7 搭建博客wordpress — LAMP

环境:
准备一台机器 ---- 192.168.184.137
系统:CentOS 7
数据库:mariadb

1、基础配置

关闭防火墙和selinux

[root@vsftp ~]# systemctl stop firewalld       # 关闭防火墙
[root@vsftp ~]# systemctl disable firewalld    # 开机自动关闭防火墙
[root@vsftp ~]# setenforce 0                   # 临时关闭selinux
[root@vsftp ~]# vim /etc/selinux/config        # 永久关闭selinux,要重启机器才生效(reboot)
SELINUX=disabled                               # 将enforcing修改为disabled 

2、安装有关的包

[root@localhost ~]# yum -y install httpd mariadb-server mariadb php php-mysql gd php-gd php-fpm

3、启动httpd服务,并在浏览器测试

[root@localhost ~]# systemctl start httpd

在浏览器访问地址,返回结果如图,即开启成功在这里插入图片描述

4、解压worpress并上传

下载中文版wordpress ,链接:https://pan.baidu.com/s/1X5kgK19BbZRIj1LHjePn5g ,提取码:tq40

可在wordpress官网下载安装包,该文档我们使用英文版wordpress

[root@localhost ~]# yum -y install wget
[root@localhost ~]# wget https://wordpress.org/wordpress-4.7.2.tar.gz
[root@localhost ~]# ls
anaconda-ks.cfg  wordpress-4.7.2.tar.gz   
[root@localhost ~]# tar xf wordpress-4.7.2.tar.gz
[root@localhost ~]# ls
anaconda-ks.cfg  wordpress-4.7.2.tar.gz  wordpress 
[root@localhost ~]# cp -r wordpress/* /var/www/html
[root@localhost ~]# systemctl restart httpd

在浏览器测试 ---- 访问192.168.184.137 在这里插入图片描述

出现以上页面即成功

5、对数据库操作

[root@localhost ~]# systemctl restart mariadb
[root@localhost ~]# mysqladmin -uroot password 123
[root@localhost ~]# mysql -uroot -p123
MariaDB [(none)]> create database wordpress;      #创建数据库wordpress
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
| wordpress          |
+--------------------+
5 rows in set (0.00 sec)
MariaDB [(none)]> flush privileges;       #刷新
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> \q
Bye
[root@localhost ~]# systemctl restart mariadb    #重启数据库

6、访问ip地址,配置wordpress在这里插入图片描述在这里插入图片描述解决上诉问题:

[root@localhost ~]# cd /var/www/html/
[root@localhost html]# ls
index.php    readme.html      wp-admin            wp-comments-post.php  wp-content   wp-includes        wp-load.php   wp-mail.php      wp-signup.php     xmlrpc.php
license.txt  wp-activate.php  wp-blog-header.php  wp-config-sample.php  wp-cron.php  wp-links-opml.php  wp-login.php  wp-settings.php  wp-trackback.php
[root@localhost html]# vim wp-config.php
###将浏览器页面的内容写入到该文件中

刷新一下浏览器页面,继续下一步在这里插入图片描述

下一步在这里插入图片描述在这里插入图片描述
出现以上页面,即博客搭建成功。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值