Mobile wallpaper 1Mobile wallpaper 2Mobile wallpaper 3Mobile wallpaper 4Mobile wallpaper 5Mobile wallpaper 6
177 字
1 分钟
基于docker的OpenResty网站部署指南
2022-09-22
统计加载中...

历经多次尝试终于部署成功,现将SCP部署方案整理如下:

1. 服务器准备#

1.1 安装 1Panel#

  1. 通过官方脚本安装1Panel运维面板
  2. 完成防火墙、SSH端口等基础安全配置

1.2 创建网站#

  1. 在1Panel控制台新建网站
  2. 域名绑定:example.com或服务器IP地址
  3. 网站根目录设置为:/opt/1panel/apps/openresty/openresty/www/sites/example.com/index
  4. 运行权限配置为UID/GID:1000

1.3 部署准备#

ssh连接服务器执行: mkdir -p /opt/1panel/apps/openresty/openresty/www/sites/example.com/index chown -R 1000:1000 /opt/1panel/apps/openresty/openresty/www/sites/example.com

2. 本地环境配置#

配置package.json自动化脚本:

“scripts”: { “upload”: “hexo clean && hexo generate && tar -czf - public/* | ssh root@<服务器IP> “cd /opt/1panel/apps/openresty/openresty/www/sites/example.com/index && rm -rf * && tar -xzf -"" }

运行部署命令: npm run upload

基于docker的OpenResty网站部署指南
https://blog.jisuk.top/posts/网站部署/
作者
不鹤Buhe
发布于
2022-09-22
许可协议
CC BY-NC-SA 4.0

部分信息可能已经过时

封面
Sample Song
Sample Artist
封面
Sample Song
Sample Artist
0:00 / 0:00