2016-07-07 5 views
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(); 
     } 
    } 
} 

나는 내 사이트를 게시하고 리눅스에 복사합니다. 리눅스 터미널에서

:

[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) 

내가 선을

".UseUrls ("http://unix:/home/xubuntusall/MyPrograms/site/kestrel.sock을 ")"제거하면

Program.cs에서 사이트가 잘 작동하지만 난 것 nginx + kestrel을 실행하려고합니다.

답변

0

흠, 사이트를 '/ home/xubuntusall/MyPrograms/site /'에서 '/ usr/site /'(및 UseUrls 변경)로 옮겼습니다.

관련 문제