簡體   English   中英

無法在Centos7(Apache)上運行ASP.NET Core

[英]Can't Run ASP.NET Core on Centos7(Apache)

由於某些原因,我無法使Apache與Kestrel一起使用。

紅est /服務正在運行

● kestrel-hellomvc.service - TestTwo Example
   Loaded: loaded (/etc/systemd/system/kestrel-hellomvc.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2017-06-28 02:35:14 UTC; 25min ago
 Main PID: 2182 (dotnet)
   CGroup: /system.slice/kestrel-hellomvc.service
           └─2182 /usr/local/bin/dotnet /var/www/applications/TestOne/TestOne.dll

Jun 28 02:35:14 abcidee systemd[1]: Started TestTwo Example.
Jun 28 02:35:14 abcidee systemd[1]: Starting TestTwo Example...
Jun 28 02:35:15 abcidee dotnet-TestTwo[2182]: Hosting environment: Production
Jun 28 02:35:15 abcidee dotnet-TestTwo[2182]: Content root path: /var/www/applications/TestOne
Jun 28 02:35:15 abcidee dotnet-TestTwo[2182]: Now listening on: http://localhost:5000
Jun 28 02:35:15 abcidee dotnet-TestTwo[2182]: Application started. Press Ctrl+C to shut down.
Jun 28 02:35:56 abcidee dotnet-TestTwo[2182]: warn: Microsoft.Extensions.DependencyInjection.DataProtectionServices[59]
Jun 28 02:35:56 abcidee dotnet-TestTwo[2182]: Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits.
Jun 28 02:35:56 abcidee dotnet-TestTwo[2182]: warn: Microsoft.AspNetCore.DataProtection.Repositories.EphemeralXmlRepository[50]
Jun 28 02:35:56 abcidee dotnet-TestTwo[2182]: Using an in-memory repository. Keys will not be persisted to storage.

httpd上的端口5001

httpd -S
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.0.0.4. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:5001                 10.0.0.4 (/etc/httpd/conf.d/hellomvc.conf:1)
*:443                  10.0.0.4 (/etc/httpd/conf.d/ssl.conf:56)

hellomvc.conf

<VirtualHost *:5001>
        ProxyPreserveHost On
        ProxyPass / http://localhost:5000/ retry=0 timeout=5
        ProxyPassReverse / http://localhost:5000/
        ServerName hostname.example.com
        ErrorLog /var/log/httpd/hellomvc-error.log
        CustomLog /var/log/httpd/hellomvc-access.log common </VirtualHost>

但是我越來越

$ curl本地主機:5001

curl:(7)無法連接到本地主機:5001; 拒絕連接

我正在使用Centos 7和Centos Web面板,=> Apache設置=>編輯Apache vHosts或/usr/local/apache/conf.d/vhosts.conf

Listen 8081
NameVirtualHost *:8081
<VirtualHost *:8081>
        ProxyRequests Off
        ProxyPreserveHost On
        ProxyPass / http://127.0.0.1:5000/
        ProxyPassReverse / http://127.0.0.1:5000/
        ServerName localdomain
        ServerAlias localdomain
</VirtualHost>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM