目录
基础环境
关闭防火墙
[root@localhost ~]# systemctl stop firewalld [root@localhost ~]# iptables -F [root@localhost ~]# setenforce 0
NAT模式能ping通www.baidu.com
配置本地yum
[root@localhost ~]# cd /etc/yum.repo.d/ [root@localhost yum.repo.d]# mkdir bak [root@localhost yum.repo.d]# mv *.repo bak [root@localhost yum.repo.d]# mv bak/CentOS-Base.repo .
安装remi库配置包(清华源获取)
[root@localhost ~]# yum -y install https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/remi-release-7.rpm
配置remi库配置包的配置文件
[root@localhost ~]# vim /etc/yum.repos.d/remi-php74.repo 将其中全部enabled=1 gpgcheck=0改为enabled=0 gpgcheck=1
安装php的加速器设置
[root@localhost ~]# yum -y install php56-php php56-php-mysqlnd mariadb-server
启动服务并设置开机自启
[root@localhost ~]# systemctl enable --now httpd mariadb
进入数据库管理
[root@localhost ~]# mysql MariaDB [(none)]> create database wordpress; MariaDB [(none)]> grant all on wordpress.* to wordpress@'localhost' identified by 'jhd2021@';
获取下载中文输入法安装包并解压
[root@localhost ~]# wget https://cn.wordpress.org/latest-zh_CN.zip [root@localhost ~]# unzip latest-zh_CN.zip
移动wordpress并赋予apache属主属组权限
[root@localhost ~]# mv wordpress/ /var/www/html/ [root@localhost ~]# chown -R apache.apache /var/www/html/
#浏览器访问
查看本机IP地址
[root@localhost ~]# ifconfig ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.111.128 netmask 255.255.255.0 broadcast 192.168.111.255
访问网站
#http://192.168.111.128/wordpress