mirror of
https://gitee.com/ThingsGateway/ThingsGateway.git
synced 2025-10-20 18:51:28 +08:00
68 lines
1.1 KiB
Plaintext
68 lines
1.1 KiB
Plaintext
---
|
||
id: windowspublish
|
||
title: Windows部署
|
||
sidebar_label: 9.2、Windows部署
|
||
---
|
||
|
||
|
||
### (一)PM2守护
|
||
|
||
详细安装请自行查找资料
|
||
|
||
查阅详细官方文档 https://pm2.keymetrics.io/docs/usage/quick-start/
|
||
|
||
下面介绍一下常用指令
|
||
|
||
- 安装pm2
|
||
|
||
```
|
||
npm install pm2@latest -g
|
||
```
|
||
|
||
|
||
- 启用应用程序
|
||
|
||
```
|
||
pm2 start pm2-windows.json
|
||
```
|
||
|
||
- 停止应用程序
|
||
|
||
```
|
||
pm2 stop pm2-windows.json
|
||
```
|
||
|
||
- 开机自动启动
|
||
|
||
```
|
||
npm install pm2-windows-startup -g //服务安装
|
||
pm2-startup install
|
||
pm2 save //每次操作pm2应用列表时需执行
|
||
```
|
||
|
||
### (二)windows服务
|
||
|
||
安装对应服务
|
||
<img src={require('../../static/img/windowspublish1.png').default} width="800" />
|
||
<img src={require('../../static/img/windowspublish2.png').default} width="800" />
|
||
|
||
**重新编译发布**
|
||
|
||
遵循windows service服务安装/启动/停止方式 https://docs.microsoft.com/zh-cn/windows-server/administration/windows-commands/sc-create
|
||
- 安装
|
||
|
||
```
|
||
sc create <Name> binPath= <Path> start= auto
|
||
net start <Name>
|
||
```
|
||
- 卸载
|
||
|
||
```
|
||
net stop <Name>
|
||
sc delete <Name>
|
||
```
|
||
|
||
### (三)IIS
|
||
|
||
自行查询相关资料 **AspNetCore/IIS**
|