centos7安装WordPress
安装Apache
sudo yum install httpd
sudo systemctl start httpd
sudo systemctl enable httpd
安装PHP
sudo yum install epel-release sudo yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm sudo yum-config-manager --enable remi-php74 sudo yum install php php-cli php-mysql php-gd php-zip php-mbstring php-xml php-imagick
安装MySQL
sudo yum install https://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm sudo yum -y install mysql-community-server sudo systemctl start mysqld sudo systemctl enable mysqld
配置MySQL
grep "temporary password" /var/log/mysqld.log mysql -u root -p # 输入上一步中的临时密码,然后修改密码 ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
创建WordPress数据库和用户
mysql -u root -p # 输入MySQL密码
CREATE DATABASE wordpress; CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
下载并安装WordPress
bashCopy code
wget https://cn.wordpress.org/latest-zh_CN.tar.gz tar -zxvf latest-zh_CN.tar.gz cp -R wordpress/* /var/www/html/ systemctl restart httpd
完成WordPress安装
通过浏览器访问你的服务器IP地址,按照WordPress的安装向导完成安装过程。
这是一个简化的步骤,确保根据需要进行适当的配置和优化。