这篇文章记录从头开始安装wordpress的过程
我想使用docker安装
先说一下我的服务器的配置
4.15.0-88-generic #88-Ubuntu SMP Tue Feb 11 20:11:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Docker version 19.03.13, build 4484c46d9d
启动wordpress
docker run --name some-wordpress -p 8080:80 -d wordpress
这样就可以在本地8080端口可以访问wordpress
配置nginx
server {
listen 80;
server_name wordpress.tangxuyang.cn;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
}
}
起初我没有配置proxy_set_header Host $host;导致页面中引用的资源都不可用,经过查看得知资源的地址是http://localhost:8080/xxx。我一下子就蒙圈了,后来才找到解决方案,就是设置host。想来wordpress一定是用了host来动态生成对静态资源的引用路径,也是优秀啊,灵活性很高!!!
上面忘记说了一个事情,就是要在dns上配置指向服务器的域名wordpress.tangxuyang.cn
配置wordpress


本文详细介绍如何使用Docker在Ubuntu服务器上安装配置Wordpress博客系统,并通过Nginx进行反向代理设置,同时介绍了使用Docker安装MySQL数据库的方法。
最低0.47元/天 解锁文章
1264

被折叠的 条评论
为什么被折叠?



