基于CentOS7.3 LAMP架构部署 Wordpress4.9.4版本博客网站,

1.部署LAMP架构

1.1准备工作

关闭防火墙和Seliunx

[root@localhost ~]# systemctl stop firewalld && setenforce 0

1.2部署架构

LAMP = Liunx + Apache + MySQL + PHP

安装Apache、MySQL、PHP

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

2.启动Apache

[root@localhost ~]# systemctl start httpd               #启动Apache
[root@localhost ~]# systemctl enable  httpd          #设置Apache服务开机自启

3.启动Mariadb

[root@localhost ~]# systemctl start mariadb           #启动
[root@localhost ~]# systemctl enable mariadb        #设置Mariadb服务开机自启

4.查看80端口是否开启

[root@localhost ~]# ss -lntp | grep 80
LISTEN     0      128         :::80                      :::*                   users:(("httpd",pid=1401,fd=4),("httpd",pid=1400,fd=4),("httpd",pid=1399,fd=4),("httpd",pid=1398,fd=4),("httpd",pid=1397,fd=4),("httpd",pid=1395,fd=4))
image.png

5.设置MySQL

[root@localhost ~]# mysql       #登录MySQL

MariaDB [(none)]> create database wordpress;     #创建wordpress

MariaDB [(none)]> create user '自定义用户'@'localhost' identified by '定义用户密码';       #创建用户和密码

MariaDB [(none)]> grant all on wordpress.* to '用户'@'localhost';                 #用户授权

MariaDB [(none)]> flush privileges;       #刷新权限

MariaDB [(none)]> show databases;          # 查看是否有wordpress库
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
| wordpress          |
+--------------------+
5 rows in set (0.01 sec)


MariaDB [(none)]> exit;                 #退出数据库

6.下载并上线wordpress

点击高速下载

[root@localhost ~]# wget https://cn.wordpress.org/wordpress-4.9.4-zh_CN.tar.gz     #下载wordpress包

[root@localhost ~]# tar xf wordpress-4.9.4-zh_CN.tar.gz            #解压wordpress包
 
[root@localhost ~]# cp -rf wordpress/* /var/www/html                 #复制到网站主目录

[root@localhost ~]# chown -R apache.apache /var/www/html                  #设置目录权限

image.png
image.png
image.png
image.png
image.png
image.png
image.png
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容