LAMP实现wordpress站点搭建实验_php

Centos8部署LAMP+wordpress

LAMP实现wordpress站点搭建实验_apache_02

安装程序

dnf -y install httpd php php-json php-mysqlnd mariadb-server
systemctl enable --now httpd mariadb
echo "<?php phpinfo(); ?>" > /var/www/html/index.php

查看PHP测试页:浏览器输入172.16.10.12/index.php

LAMP实现wordpress站点搭建实验_php_03

数据库配置

mysql
MariaDB [(none)]> create database wordpress;
MariaDB [(none)]> grant all on wordpress.* to wordpress@'localhost' identified by 'linweiwei';
MariaDB [(none)]> flush privileges;

Wordpress部署

上传已经下载好的安装包,或去官网下载​https://cn.wordpress.org/

LAMP实现wordpress站点搭建实验_html_04

tar xf wordpress-5.9-zh_cn.tar.gz 
mv wordpress/* /var/www/html/
chown -R apache.apache /var/www/html/ #apache默认使用账户,根据生产情况可调整

#浏览器访问
http://LAMP服务器地址/wordpress

LAMP实现wordpress站点搭建实验_html_05

LAMP实现wordpress站点搭建实验_php_06

LAMP实现wordpress站点搭建实验_apache_07