文章目录
LAMP环境准备
就是Linux、apache、mysql、php
子系统安装ubuntu 20.04
安装过程略
换源
sudo cp /etc/apt/source.list /etc/apt/source.list.backup
sudo vim /etc/apt/source.list
# 阿里源
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
安装apache2
、mysql
、php7.4
sudo apt install -y apache2 libapache2-mod-php mysql-client mysql-server php7.4 php7.4-fpm php7.4-mysql
启动apache2
、mysql
、php7.4
服务
sudo service apache2 start
sudo service mysql start
sudo service php7.4-fpm start
mysql数据库配置
sudo mysql -uroot -proot
CREATE DATABASE wordpress;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY '';
// mysql < 8
GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost' IDENTIFIED BY '';
// mysql >= 8
GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;
quit
安装wordpress
下载地址
https://cn.wordpress.org/download/
基础配置
cd /var/www/html
sudo wget https://cn.wordpress.org/latest-zh_CN.tar.gz //下载wordpress
sudo tar xzvf wordpress-5.0.4-zh_CN.tar.gz wordpress/ //解压wordpress文件
sudo chmod -R 777 wordpress
现在可以通过访问http://localhost/wordpress来打开wordpress
其他配置
不使用ftp下载更新
在wp-config.php文件添加以下代码:
define('FS_METHOD','direct');
常用插件
# TODO