服务器
服务器我是在野草云购买的,花了300大洋买了一年,安装了几个服务,1Panel、docker、caddy。
docker中部署了mysql和halo。
域名
域名是我从阿里云购买的,很便宜,由于之前没有做过域名相关的操作,搞了好久才终于完成。
域名购买流程省略。
解析流程:
1、登录阿里云,点击控制台,找到云解析DNS。选择对应的域名,点击解析设置。
2、配置解析记录 www 和 @ ,搞定。
碰到了那些坑
超级大坑:反向代理后,防火墙没有开启80端口,导致一直访问不了。
1Panel的软件商店中的OpenResty不会用,搞了好久还是不行,不知道是因为什么。
最后使用的是caddy,配了一个反向代理就好了。
# The Caddyfile is an easy way to configure your Caddy web server.
#
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
#
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace ":80" below with your
# domain name.
:80 {
# Set this path to your site's directory.
root * /usr/share/caddy
# Enable the static file server.
file_server
# Another common task is to set up a reverse proxy:
# reverse_proxy localhost:8080
# Or serve a PHP site through php-fpm:
# php_fastcgi localhost:9000
}
www.ashuai.xin {
reverse_proxy 127.0.0.1:8090
}
# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile