基于lamp搭建wordpress个人博客

  • lamp:Linux(操作系统) 、Apache (网页服务器)、MariaDB或Mysql(数据库管理系统,数据库服务器)、Php或Python(脚本语言)
  • wordpress:是使用PHP语言开发的博客平台

搭建过程:

建议取消防火墙

1.安装各种安装包

[root@westos_netfilesystem shell]# yum install httpd mariadb-server php php-mysql -y

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

2.关闭防火墙

[root@westos_netfilesystem shell]# systemctl stop firewalld.service
[root@westos_netfilesystem shell]# systemctl disable firewalld.service
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

在这里插入图片描述

3.关闭selinux

[root@westos_netfilesystem shell]# setenforce 0

在这里插入图片描述

  • 永久关闭selinux
[root@westos_netfilesystem mnt]# vim /etc/sysconfig/selinux

在这里插入图片描述

在这里插入图片描述

4.下载并解压wordpress安装包

[root@westos_netfilesystem Downloads]# tar xf wordpress-4.7.2-zh_CN.tar.gz

在这里插入图片描述

5.切换目录

[root@westos_netfilesystem Downloads]# mv wordpress /var/www/html
[root@westos_netfilesystem Downloads]# cd
[root@westos_netfilesystem ~]# cd /var/www/html
[root@westos_netfilesystem html]# ls
wordpress
[root@westos_netfilesystem html]# cd wordpress

在这里插入图片描述

6.开启服务

[root@westos_netfilesystem wordpress]# systemctl start httpd
[root@westos_netfilesystem wordpress]# systemctl enable httpd
[root@westos_netfilesystem wordpress]# systemctl start mariadb
[root@westos_netfilesystem wordpress]# systemctl enable mariadb

在这里插入图片描述

7.测试

[root@westos_netfilesystem mnt]# cd /var/www/html
[root@westos_netfilesystem html]# ls
wordpress
[root@westos_netfilesystem html]# vim index.html

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

8.修改端口

[root@westos_netfilesystem html]# vim /etc/httpd/conf/httpd.conf

在这里插入图片描述

将此处80端口按要求修改为8080端口:
在这里插入图片描述
在这里插入图片描述

[root@westos_netfilesystem html]# systemctl restart httpd
[root@westos_netfilesystem html]# curl http://127.0.0.1:8080
这是一个论坛

重启:
在这里插入图片描述
用之前的端口在次访问:
在这里插入图片描述
加上修改后的端口8080访问成功:
在这里插入图片描述

在这里插入图片描述

9.创建数据库

[root@westos_netfilesystem html]# mysql -uroot -p123 -e "create database wordpress default charset='utf8'"

在这里插入图片描述

10.打开apache后可访问readme.html

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

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值