Centos 7 & amp; dotnet core 2.0 & amp; nginx & amp; supervisor, centos

Source: Internet
Author: User
Tags dotnet

Centos 7 & dotnet core 2.0 & nginx & supervisor, centos
Prerequisites

System: centos 7

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

Dotnet core 2.0

Official Guide

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

Install and enable

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;

}

}

 

Heavy Load

sudo nginx -s reload

Enable 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

Install

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 configurations

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 daemon

supervisord -c /etc/supervisor/supervisord.conf

Common commands

supervisorctl start program_name

supervisorctl reload

Complete

Access www.wuball.com (example)

 

Related Article

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.