##### nginx install #####
/etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1
sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
sudo yum install nginx
sudo systemctl start nginx
sudo systemctl enable nginx
##### nginx setting #####
sudo mkdir /etc/nginx/sites-available
sudo mkdir /etc/nginx/sites-enabled
sudo nano /etc/nginx/sites-enabled/
include /etc/nginx/sites-enabled/*.conf;
server_names_hash_bucket_size 64;
sudo cp /etc/nginx/conf.d/default.conf /etc/nginx/sites-available/dev.easywaru.com.conf
sudo nano /etc/nginx/sites-available/dev.easywaru.com.conf
server_name dev.easywaru.com www.dev.easywaru.com
location
root
proxy_pass http://localhost:5001;
proxy_redirect off;
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;
sudo ln -s /etc/nginx/sites-available/dev.easywaru.com.conf /etc/nginx/sites-enabled/dev.easywaru.com.conf
##### dotnetcore install #####
yum install -y libunwind libicu
curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?LinkID=835019
mkdir -p /opt/dotnet && sudo tar zxf dotnet.tar.gz -C /opt/dotnet
ln -s /opt/dotnet/dotnet /usr/local/bin
##### dotnetcore to service instance #####
sudo nano /etc/systemd/system/dotnet_easywaru_com.service
[Unit]
Description=Service Sample on CentOS7
[Service]
ExecStart=/usr/local/bin/dotnet /opt/webapp/WebApplication1.dll
Restart=always
RestartSec=10
SyslogIdentifier=dotnet_easywaru_com
User=root
Environment=ASPNETCORE_ENVIRONMENT=Production
WorkingDirectory=/opt/webapp
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl start dotnet_easywaru_com
sudo systemctl enable dotnet_easywaru_com
##### copy dll by PSCP #####
pscp -r /WebApplication1/bin/Release/PublishOutput/ root@150.95.145.244:/opt/webapp