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