Asp.net core Net Core 2.2 AWS RHEL 7.5部署
我正在尝试在AWS RHEL 7.5上部署我的第一个ASP.NET Core 2.2 API my/etc/systemd/system/kestrel-mytest.serviceAsp.net core Net Core 2.2 AWS RHEL 7.5部署,asp.net-core,Asp.net Core,我正在尝试在AWS RHEL 7.5上部署我的第一个ASP.NET Core 2.2 API my/etc/systemd/system/kestrel-mytest.service [Unit] Description=.NET Prototypes Application on Linux [Service] WorkingDirectory=/home/ec2-user/webapi ExecStart=/usr/bin/dotnet /home/ec2-user/webapi/prot
[Unit]
Description=.NET Prototypes Application on Linux
[Service]
WorkingDirectory=/home/ec2-user/webapi
ExecStart=/usr/bin/dotnet /home/ec2-user/webapi/prototypes.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=dotnet-example
User=apache
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
TimeoutStopSec=90
[Install]
WantedBy=multi-user.target
现在我面对的是:
[ec2-user@ip-172-31-6-33 dotnet]$ sudo systemctl status kestrel-mytest.service
â kestrel-mytest.service - .NET Prototypes Application on Linux
Loaded: loaded (/etc/systemd/system/kestrel-mytest.service; disabled; vendor preset: disabled)
Active: activating (auto-restart) (Result: exit-code) since Tue 2019-02-19 14:06:39 UTC; 6s ago
Process: 3902 ExecStart=/usr/bin/dotnet /home/ec2-user/webapi/prototypes.dll (code=exited, status=145)
Main PID: 3902 (code=exited, status=145)
Feb 19 14:06:39 ip-172-31-6-33.ap-southeast-1.compute.internal systemd[1]: kestrel-mytest.service: main process exited, code=exited, status=145/n/a
Feb 19 14:06:39 ip-172-31-6-33.ap-southeast-1.compute.internal systemd[1]: Unit kestrel-mytest.service entered failed state.
Feb 19 14:06:39 ip-172-31-6-33.ap-southeast-1.compute.internal systemd[1]: kestrel-mytest.service failed.
[ec2-user@ip-172-31-6-33 dotnet]$
我错过了什么
提前多谢
Don这将解决:
工作目录必须与Apache/etc/httpd/conf/httpd.conf的DocumentRoot相同在我的例子中,DocumentRoot是/var/www/html/so,它应该是:
WorkingDirectory=/var/www/html/webapi,执行以下操作:
ExecStart=/usr/bin/dotnet/var/www/html/webapi/prototype.dll
需要考虑的事项:
chown-R apache:your_group/var/www/html/webapi
别忘了停下来启动红隼来生效
系统控制停止红隼xxx
系统控制启动红隼xxx
systemctl使kestrel xxx在机器重新启动后自动启动
检查dotnet侦听器端口状态的步骤
sudo lsof-i-p-n | grep听着你救了我这么多。很时间非常感谢。