admin管理员组文章数量:1430876
我本地的环境是 rk3399机器,安装armbian系统。
1.安装 core 组件
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-8.0
或者安装运行库,但无法生成编译项目
sudo apt-get update && \
sudo apt-get install -y aspnetcore-runtime-8.0
2.编译项目,生成dll,上传到服务器中
3.运行项目
dotnet /var/www/aspnetcore/VDLand.dll --urls “http://*:2001” 端口为2001。这时候启动浏览器,访问ip+:+端口就可以看到网页了。
4.设置开机自启动
在/etc/systemd/system/ 中创建文件 vdland.service
[Unit]
Description=My very first ASP.NET Core applications running on Ubuntu
[Service]
WorkingDirectory=/var/www/aspnetcore
ExecStart=/usr/bin/dotnet /var/www/aspnetcore/VDLand.dll --urls "http://*:2001"
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=myfirstapp-identifier
User=www-data
Environment=ASPNETCORE_ENVIRONMENT=Development
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
[Install]
WantedBy=multi-user.target
然后运行:
sudo systemctl enable myfirstwebapp.service
这样项目就会开机自启动了,并且遇到错误关闭后也会自动重启。
本文标签: 项目ArmbianUbuntudebiancore
版权声明:本文标题:debian ubuntu armbian部署asp.net core 项目 开机自启动 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/biancheng/1743966940a2570051.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论