安装配置 WordPress
概述
Wordpress 需要我们首先安装配置好 MySQL,Nginx 以及 PHP。
安装与配置 MySQL
安装
sudo apt-get update
sudo apt-get install mysql-server
How To Install MySQL on Ubuntu 16.04
配置
终端输入 sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
编辑配置文件,
注释掉 bind-address = 127.0.0.1,以允许远程访问。
终端输入 mysql -uroot -p
以进入 MySQL 的 Shell
CREATE USER 'username'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'username'@'%';
FLUSH PRIVILEGES;
创建 Wordpress 所需要的数据库以及相应的用户
CREATE DATABASE blog;
GRANT ALL PRIVILEGES ON blog.* TO "username"@"localhost" IDENTIFIED BY "password";
FLUSH PRIVILEGES;
PHP
https://websiteforstudents.com/install-php-7-3-php-7-3-fpm-with-apache2-nginx-on-ubuntu-16-04-18-04-18-10/ https://www.rosehosting.com/blog/how-to-install-php-7-3-on-ubuntu-16-04/
https://www.cloudbooklet.com/how-to-install-php-7-3-on-ubuntu-18-04/
WordPress
下载:wget https://wordpress.org/latest.tar.gz
遇到问题:“Unable to create directory wp-content/uploads/ ”以及 “To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed”.
这两个问题都是由于 wp-content 文件夹的权限设置不正确导致的。
cd /var/www/wordpress
sudo chown -R www-data:www-data wp-content
还有一个问题:“Maximum upload file size: 2 MB.”,此问题尚未解决。
Links: 安装配置-WordPress