1.1 安装LAMP组件
mount /dev/cdrom /media/CentOS/
yum install httpd mariadb-server php -y
1.2 下载Wordpress
wget https://cn.wordpress.org/wordpress-5.1.11-zh_CN.tar.gz
tar xzvf wordpress-5.1.11-zh_CN.tar.gz
#启动apache服务
systemctl enable --now httpd
firewall-cmd --add-service=http
firewall-cmd --add-service=http permanent
#拷贝网站代码到apache根
cp wordpress/* /var/www/html/. -r
#安装php mysql扩展
yum install php-mysqlnd -y
1.3 创建数据库并授权
systemctl enable --now mariadb
mysql_secure_installation
mysql -uroot -pcentos
MariaDB [(none)]> grant all on wordpress.* to 'wordpress'@'localhost' identified by 'centos';
MariaDB [(none)]> flush privileges;
1.4 通过浏览器访问wordpress启动安装
http://192.168.99.201
创建wp-config.php
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpress' );
/** MySQL database username */
define( 'DB_USER', 'wordpress' );
/** MySQL database password */
define( 'DB_PASSWORD', 'centos' );
/** MySQL hostname */
define( 'DB_HOST', 'localhost' );
1.5 解决附件无法上传问题
[root@web01 html]# chown apache:apache /var/www/html/wp-content/ -R