首页 帮助中心 香港大带宽服务器 CentOS7 下部署 .Net Core+Nginx
CentOS7 下部署 .Net Core+Nginx
时间 : 2022-11-10 09:23:25 编辑 : 华纳云 阅读量 : 127

记录在CentOS7 下 .NetCore+Nginx 部署简单过程,供参考。

安装DotNet SDK 官方文档

添加镜像订阅

https://www.hncloud.com/uploads/UEditorImages/202211/10/41aba4fbcbc016386942c74d7da914ab.jpg

安装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

https://www.hncloud.com/uploads/UEditorImages/202211/10/61bfb04f2468a3eacce7fe821ee5fd58.jpg

启动服务

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>

https://www.hncloud.com/uploads/UEditorImages/202211/10/273288074abb9e6c3d44a8a2715aaae0.jpg

重新加载

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

https://www.hncloud.com/uploads/UEditorImages/202211/10/f5aea44ae339210a76c7d7ae2a7b0e58.jpg

华纳云 推荐文章
IIS图片防盗链和下载的解决方案 提示iis 无法启动World Wide Web Publishing服务的解决办法 CentOS中部署zeromq消息队列 IIS6架设网站过程常见问题解决方法总结 CentOS7下如何快速安装MySQL Windows2003 服务器安全配置详细篇 Centos下搭建Apache环境具体方法 CentOS上安装SQL Server 详解Ubuntu 18.04.1基本使用方法 Ubuntu 配置单root用户登录具体方法
客服咨询
7*24小时技术支持
技术支持
渠道支持