asp.net core 在Ubuntu 运行
环境:
- Ubuntu 16.04
- dotnet-dev-1.0.0-preview2-003121
- Visual Studio 2015 update 3
Ubuntu 安装.net core 参考:https://www.microsoft.com/net/core#ubuntu
1.添加源
sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list' sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893 sudo apt-get update
2.安装
sudo apt-get install dotnet-dev-1.0.0-preview2-003121
3.把程序上传到 /home/zulin/dotnet 目录
发布
运行 还原 并运行
dotnet coredemo.dll
4.配置nginx 代理
#安装 sudo apt-get install nginx
#配置 sudo nano /etc/nginx/sites-available/default#添加到后尾 server {# Port and domainlisten 8080;server_name aspnet.local;# Path to the wwwroot folderroot /home/zulin/dotnet/wwwroot;# Pass requests to Kestrellocation / {proxy_pass http://127.0.0.1:5000;proxy_set_header Connection "";proxy_http_version 1.1;} }
#重启服务 sudo service nginx restart
现在可以在浏览器上查看了
http://xxx.xxx.xxx.xxx:8080
posted on 2016-07-02 11:11 Julian.Huang 阅读(...) 评论(...) 编辑 收藏