美文网首页
在阿里云轻量级服务器创建服务

在阿里云轻量级服务器创建服务

作者: 寻找无名的特质 | 来源:发表于2021-10-21 05:54 被阅读0次

开发完成ABP应用,需要部署在阿里云轻量级服务器上,需要将ABP应用作为后台服务运行。首先在/etc/systemd/system目录中创建新文件kestrel-zldnnapp.service,代码如下:

[Unit]
Description=ZLDNN ABP App

[Service]
WorkingDirectory=/dotnet/zldnn
ExecStart=/dotnet/zldnn/ZLDNN.OrderManagement.Web
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=zldnn
User=root
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false

[Install]
WantedBy=multi-user.target

然后运行:

sudo systemctl enable kestrel-zldnnapp.service

启动服务并查看运行状态:

sudo systemctl start kestrel-zldnnapp.service
sudo systemctl status kestrel-zldnnapp.service

服务就部署完成了。如果需要更新应用,需要将服务停止。

相关文章

网友评论

      本文标题:在阿里云轻量级服务器创建服务

      本文链接:https://www.haomeiwen.com/subject/lgdmoltx.html