日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷(xiāo)解決方案
CentOS7 下部署 .Net Core+Nginx

記錄在centos7 下 .NetCore+Nginx 部署簡(jiǎn)單過(guò)程,供參考。

安裝DotNet SDK 官方文檔

添加鏡像訂閱

rpm --import https://packages.microsoft.com/keys/microsoft.asc

sh -c 'echo -e "[packages-microsoft-com-prod]\nname=packages-microsoft-com-prod \nbaseurl= https://packages.microsoft.com/yumrepos/microsoft-rhel7.3-prod\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/dotnetdev.repo'

安裝SDK

sudo yum install libunwind libicu
sudo yum install dotnet-sdk-2.1.3

查看安裝

dotnet --version

上傳站點(diǎn) 官方文檔

psftp [主機(jī)地址]

put D:\website.7z

解壓文件,使用的是 p7zip

7za x website.7z

創(chuàng)建服務(wù)

vi /etc/systemd/system/website.service
[Unit]
Description=Web API Application running on CentOS

[Service]
WorkingDirectory=/home/website
ExecStart=/usr/bin/dotnet /home/website/website.dll
Restart=always
RestartSec=10 # Restart service after 10 seconds if dotnet service crashes
SyslogIdentifier=website
User=root
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false

[Install]
WantedBy=multi-user.target

啟動(dòng)服務(wù)

systemctl start website systemctl enable website

測(cè)試站點(diǎn)

curl localhost:8010

安裝Nginx

yum install -y nginx

啟動(dòng),測(cè)試

systemctl start nginx nginx -v

修改配置文件

cd /etc/nginx

vi /etc/nginx/conf.d/vhost_website.conf
server {
    server_name [test.xxx.com];
    root         /home/website;

    location / {
        proxy_pass http://localhost:8010;
    }
}

重新加載

systemctl restart nginx

瀏覽器打開(kāi)

http://[test.xxx.com]

其它異常

1.Unable to bind to http://localhost:5000 on the IPv6 loopback interface: ‘Error -99 EADDRNOTAVAIL address not available’.

添加hosting.json

{
  "server.urls": "http://*:8010" }

修改Program

public static void Main(string[] args)
{
    var config = new ConfigurationBuilder()
        .SetBasePath(Directory.GetCurrentDirectory())
        .AddJsonFile("hosting.json", optional: true)
        .Build();

    WebHost.CreateDefaultBuilder(args)
        .UseConfiguration(config)
        .UseStartup()
        .Build()
        .Run();
}

當(dāng)前標(biāo)題:CentOS7 下部署 .Net Core+Nginx
標(biāo)題網(wǎng)址:http://www.5511xx.com/article/dpjgped.html