CentOS 7 && dotnet Core 2.0 && nginx && Supervisor

Source: Internet
Author: User
Tags dotnet

Premise

System: CentOS 7

Catalog:/home/wwwroot/www.wuball.com

Dotnet Core 2.0

Official guidelines

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

sudo 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"

sudo yum update

sudo yum install libunwind Libicu

sudo yum install dotnet-sdk-2.0.0

Nginx

Installation enabled

Yum Install Nginx

Systemctl start Nginx

Systemctl Enable Nginx

Configuration

Vi/etc/nginx/conf.d/www.wuball.com.conf

Add the following content

server {

Listen 80;

server_name www.wuball.com;

Location/{

Proxy_pass http://localhost:5000;

Proxy_http_version 1.1;

Proxy_set_header Upgrade $http _upgrade;

Proxy_set_header Connection keep-alive;

Proxy_set_header Host $host;

Proxy_cache_bypass $http _upgrade;

}

}

Overload

sudo nginx-s reload

Turn on the HTTP/HTTPS firewall port

sudo firewall-cmd--permanent--add-port=80/tcp

sudo firewall-cmd--permanent--add-port=443/tcp

sudo firewall-cmd--reload

Supervisor

Installation

Yum Install Python-setuptools

Easy_install Supervisor

Mkdir-m 755-p/etc/supervisor

echo_supervisord_conf >/etc/supervisor/supervisord.conf

cd/etc/supervisor/

Mkdir-m 755 CONF.D

Modify Configuration

Vi/etc/supervisor/supervisord.conf

[include]

Files = Conf.d/*.ini

Configuration daemon

Vi/etc/supervisor/conf.d/www.wuball.com.ini

Add the following content

[Program:www.wuball.com]

Command=/bin/bash-c "cd/home/wwwroot/www.wuball.com && dotnet Project.Wuball.dll"

Directory=/home/wwwroot/www.wuball.com

Autostart=true

Autorestart=true

Stderr_logfile=varlog Www.wuball.com.err.log

Stdout_logfile=varlog Www.wuball.com.out.log

Environment=aspnetcore_environment=production

User=root

Stopsignal=int

Start Guard

Supervisord-c/etc/supervisor/supervisord.conf

Common commands

Supervisorctl Start program_name

Supervisorctl Reload

Complete

accessing Www.wuball.com (example)

CentOS 7 && dotnet Core 2.0 && nginx && Supervisor

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.