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