1
私はASP.NET Core 1.0サイトを持っています。ASP.NET Core 1.0、Linux、NGINX、エラー-1 EPERM操作が許可されていません
私の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にコピーします。私はProgram.csのからのラインに
".UseUrls(" http://unix:/home/xubuntusall/MyPrograms/site/kestrel.sock ")"
を削除すると、サイトがうまくいく
[email protected]:~/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)
、私:Linuxターミナルで
nginx + kestrelを実行しようとしています。