从零开始部署博客到阿里云的服务器
购买阿里云的服务器
登录到服务器上ssh root@你的服务器ip
安装nginx
- 更新本地软件包索引:
sudo apt update
- 安装
nginx
:sudo apt install -y nginx
安装https(如果不需要就不用走这一步)
apt-get install python-software-properties apt-get install software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install -y certbot python3-certbot-nginx
生成证书
- 停掉nginx:
service nginx stop
- 生成对应域名的证书:
certbot certonly --standalone -d 你的域名
(📢这里的域名需要解析到你当前的服务器上否则会报错)
配置nginx
1 | server { |
启动nginx
执行service nginx start
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 墨陌默!
评论