WordPress建站踩坑历程
2026/4/9大约 1 分钟
WordPress建站踩坑历程
搭建
为了后期的维护,在docker-compose.yml中配置端口映射的同时,添加对22端口的映射
主题
WordPress 主题 Sakura 🌸 | 樱花庄的白猫 (2heng.xin)
容器管理
1.更新软件园
apt-get update2.下载ssh
apt-get install ssh3.下载git
apt-get install git4.创建.git,并在其中生成密钥
5.想要容器可以被ssh,需要sshd
sudo apt-get install openssh-server
sudo /etc/init.d/ssh start#启用公钥私钥配对认证方式
PubkeyAuthentication yes
#公钥文件路径(和上面生成的文件同)
AuthorizedKeysFile .ssh/authorized_keys
PermitRootLogin yes #root能使用ssh登录
#参数数值是秒 , 是指超时时间
ClientAliveInterval 60
#设置允许超时的次数
ClientAliveCountMax 3阿里源镜像
FROM ubuntu:20.04
RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak && \
echo "deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted" >/etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/ubuntu/ focal universe" >/etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/ubuntu/ focal-updates universe" >/etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/ubuntu/ focal multiverse" >/etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/ubuntu/ focal-updates multiverse" >/etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse" >/etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted" >/etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/ubuntu/ focal-security universe" >/etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/ubuntu/ focal-security multiverse" >/etc/apt/sources.list插件
| 链接管理跳转 | Pretty Links |
docker容器下mysql更改WordPress的site address和home(URL)------局域网 - dora_shao - 博客园 (cnblogs.com)