Step1:将yum更新为最新,并且添加添加Node.js源
sudo yum -y update
sudo curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -
Step2:安装Node.js
yum -y install nodejs
Step3:安装PM2进程守护
npm install pm2 -g
Step4:把Microsoft包签名密钥添加到受信任密钥列表
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
Step5:安装.net6运行时
sudo yum install aspnetcore-runtime-6.0
Step6:安装pm2进程守护,监控server服务,并且固化,设置自动重启
pm2 start "dotnet 程序名.dll --urls=http://*:端口号 --environment Production" --name PM2进程名
pm2 save
pm2 startup systemd