gpt4 book ai didi

linux - ASP.NET Core 1.0、Linux、NGINX、错误-1 EPERM 操作不允许

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:24:04 24 4
gpt4 key购买 nike

我有 ASP.NET Core 1.0 网站。

我的 Program.cs 文件:

using System.IO;
using Microsoft.AspNetCore.Hosting;

namespace A2Site
{
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.UseUrls("http://unix:/home/xubuntusall/MyPrograms/site/kestrel.sock")
.Build();

host.Run();
}
}
}

我发布我的网站并复制到 linux。

在 linux 终端中:

xubuntusall@PCXubuntuSall:~/MyPrograms/site$ dotnet ./A2Site.dll
dbug: Npgsql.NpgsqlConnection[3]
Opening connection to database 'karpova' on server 'tcp://194.58.246.16:5432'.
info: Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommandBuilderFactory[1]
Executed DbCommand (996ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT CASE
WHEN EXISTS (
SELECT 1
FROM "Pages" AS "p")
THEN TRUE::bool ELSE FALSE::bool
END
dbug: Npgsql.NpgsqlConnection[4]
Closing connection to database 'karpova' on server 'tcp://194.58.246.16:5432'.

Unhandled Exception: System.AggregateException: One or more errors occurred. (Error -1 EPERM operation not permitted) ---> Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -1 EPERM operation not permitted
at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.Libuv.Check(Int32 statusCode)
at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.PipeListener.CreateListenSocket()
at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Listener.<>c.<StartAsync>b__6_0(Object state)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Server.Kestrel.Internal.KestrelEngine.CreateServer(ServerAddress address)
at Microsoft.AspNetCore.Server.Kestrel.KestrelServer.Start[TContext](IHttpApplication`1 application)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.Start()
at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host, CancellationToken token, String shutdownMessage)
at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host)
at A2Site.Program.Main(String[] args)
Aborted (core dumped)

如果我删除行

".UseUrls("http://unix:/home/xubuntusall/MyPrograms/site/kestrel.sock ")"

在 Program.cs 中,该站点运行良好,但我正在尝试运行 nginx + kestrel。

最佳答案

嗯,我将站点从“/home/xubuntusall/MyPrograms/site/”移动到“/usr/site/”(并更改了 UseUrls)并且它可以工作。

关于linux - ASP.NET Core 1.0、Linux、NGINX、错误-1 EPERM 操作不允许,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38248816/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com