windows环境中springboot服务注册为系统服务

windows环境中springboot服务注册为系统服务

需要借助工具Winsw.net4.exe

下载地址:https://github.com/kohsuke/winsw/releases
完成后,将此程序和java程序放置在相同目录

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

管理员身份运行cmd窗口,注意一定要使用管理员身份打开,否则服务无法启动时无法删除服务。
使用 xxx.exe install命令安装服务
=====================================================================================

安装部署nginx

1、解压
D:\app\nginx
2、修改nginx.conf
3、启动
cd nginx1.20
start nginx
nginx -t
# 解压的Nginx路径不能有中文,否则启动不起来
nginx注册为系统服务
下载(安装包中会附带)
WinSW.NET4.exe
sample-minimal.xml

放置在nginx安装目录,修改WinSW.NET4.exe名称为nginx-service.exe ,修改sample-minimal.xml名称为nginx-service.xml,修改nginx-service.xml配置文件
<service>
  
  <!-- ID of the service. It should be unique across the Windows system-->
  <id>nginx</id>
  <!-- Display name of the service -->
  <name>Nginx Service</name>
  <!-- Service description -->
  <description>Nginx Service</description>
  
  <!-- Path to the executable, which should be started -->
  <executable>D:\TgProject\nginx-1.20.2\nginx.exe</executable>
  
</service>

执行cmd命令 nginx-service.exe install
查看是否注册系统服务成功
卸载命令   
执行cmd命令 nginx-service.exe uninstall

安装部署redis

解压,配置环境系统环境变量
注册为系统服务
进入到redis安装目录
# 执行命令注册为系统服务
redis-server --service-install redis.windows.conf --loglevel verbose
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值