记录在CentOS7 下 .NetCore+Nginx 部署简单过程,供参考。
安装DotNet SDK 官方文档
添加镜像订阅
安装SDK
<span>sudo</span> yum install libunwind libicu
<span>sudo</span> yum install dotnet-sdk-<span>2.1</span>.<span>3</span>
查看安装
<span>dotnet</span> <span>-</span><span>-</span><span>version</span>
上传站点 官方文档
<span>psftp</span> <span>[主机地址]</span>
<span>put</span> <span>D</span>:\<span>website</span><span>.7z</span>
解压文件,使用的是 p7zip
7za x website.7z
创建服务
vi /etc/systemd/<span>system</span>/website.service
启动服务
systemctl <span><span>start</span> website systemctl enable website</span>
测试站点
<span>curl</span> <span>localhost</span><span>:8010</span>
安装Nginx
yum <span>install</span> -y nginx
启动,测试
systemctl <span><span>start</span> nginx nginx -v</span>
修改配置文件
cd /etc/nginx
vi /etc/nginx/conf<span>.d</span>/vhost_website<span>.conf</span>
重新加载
systemctl restart nginx
浏览器打开
<span>http://</span>[<span>test.xxx.com</span>]
其它异常
1.Unable to bind to http://localhost:5000 on the IPv6 loopback interface: ‘Error -99 EADDRNOTAVAIL address not available’.
添加hosting.json
{
"<span>server.urls</span>": <span><span>"http://*:8010"</span> </span>}
修改Program