惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
罗磊的独立博客
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Last Week in AI
Last Week in AI
美团技术团队
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
Docker
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
月光博客
月光博客
L
LINUX DO - 最新话题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
W
WeLiveSecurity
H
Heimdal Security Blog
Vercel News
Vercel News
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
A
About on SuperTechFans
C
Check Point Blog
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
AI
AI
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
博客园_首页
The Last Watchdog
The Last Watchdog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
I
Intezer
K
Kaspersky official blog
M
MIT News - Artificial intelligence
J
Java Code Geeks
G
GRAHAM CLULEY
P
Palo Alto Networks Blog

Blog - 分类 - cywhat's blog

暂无文章

Docker部署wordpress站点
cywhat · 2022-04-15 · via Blog - 分类 - cywhat's blog

1.拉取docker镜像

1
2
3
docker pull wordpress

docker pull mysql

2.创建mysql容器

1
docker run -d --name mysql -v mysql-data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=wordpress mysql

参数解析

-d 后台运行容器,并返回容器id

--name 自定义容器名

-v 将容器内的目录挂载到宿主机中(前是宿主机路径/后是容器路径)

-e 用来指定环境变量以及后续的键值对

MYSQL_ROOT_PASSWORD 数据库密码

MYSQL_DATABASE 数据库表名

mysql 镜像仓库中的镜像标签版本

3.创建 wordpress 容器

1
docker run -d --name wordpress -e WORDPRESS_DB_HOST=mysql:3306 --link mysql -p 8083:80 wordpress

参数解析

-d 后台运行容器,并返回容器id

--name 自定义容器名

-e 用来指定环境变量以及后续的键值对

WORDPRESS_DB_HOST 数据库链接

--link 关联到另一台容器,后面加容器名

-p 指定端口映射(前是宿主机/后是容器端口)

wordpress wordpress镜像

4.访问地址

1
2
3
用户地址:https://服务器ip:8083

管理地址:https://服务器ip:8083/wp-admin/

5.异常问题解决

url访问后,页面出现以下问题

1
Error establishing a database connection

解决办法

1.进入容器 docker exec -it 容器id /bin/bash

2.编辑配置文件 vim wp-config.php

3.修改数据库账号和密码 修改下图红框中的内容为你的数据库账号和密码,注意不要去掉引号 /img/img54.png

关注一下再走吧

公众号 小程序

赞赏支持

微信打赏 支付宝打赏