不能 运行 ASP.NET Core on Centos7(Apache)
Can't Run ASP.NET Core on Centos7(Apache)
由于某些原因,我无法让 Apache 与 Kestrel 一起工作。
Kestrel/Service 是 运行
● 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 localhost:5001
curl: (7) 无法连接到 localhost: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>
由于某些原因,我无法让 Apache 与 Kestrel 一起工作。
Kestrel/Service 是 运行
● 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 localhost:5001
curl: (7) 无法连接到 localhost: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>