前段时间帮朋友写了一个网站,现在做一个记录。
.Net Core 安装:
1 curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg 2 sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg 3 sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list' 4 sudo apt-get update 5 sudo apt-get install dotnet-sdk-2.0.0
参考自:https://www.microsoft.com/net/core#linuxubuntu
Nginx安装:
1 sudo apt-get install update 2 sudo apt-get install nginx
参考字:http://blog.csdn.net/woshihaiyong168/article/details/53927308
MySql安装:
1 sudo apt-get install mysql-server
其中输入两次来设置Root密码。
然后需要配置远程连接,请参考:http://www.cnblogs.com/BTMaster/p/4035402.html
Supervisor安装:
1 sudo apt-get install supervisor
参考自:http://blog.csdn.net/github_37730997/article/details/60582525
以上,安装内容就完成了。
配置:
Supervisor配置:
参考自:http://blog.csdn.net/shengzhu1/article/details/54348371
1 [program:Project_Name] 2 command=/usr/bin/dotnet ???.dll 3 directory=Project_Publish_location 4 autostart=true 5 autorestart=true 6 stderr_logfile=/var/log/Error.err.log 7 stdout_logfile=/var/log/Out.out.log 8 user=root 9 stopsignal=INT
.net core 编译:
1 dotnet publish
Supervisor 启动和停止:
1 sudo service supervisor start 2 sudo service supervisor stop
Nginx配置:
1 location / { 2 proxy_pass http://localhost:5000; 3 proxy_http_version 1.1; 4 proxy_set_header X-Forwarded-For $remote_addr; 5 proxy_set_header Upgrade $http_upgrade; 6 proxy_set_header Connection keep-alive; 7 proxy_set_header Host $host; 8 proxy_cache_bypass $http_upgrade; 9 }