linux centos7 和 windows下 部署 .net core 2.0 web应用
centos7 下部署asp.net core 2.0应用
- 安装CentOS7
- 配置网络【可选】
- 安装.Net core2.0
- 创建测试Asp.net Core应用程序
- 正式部署项目
安装VMware->新建虚拟机->找到系统镜像->一步一步往下装,不多说了。。
如果ping baidu.com ping不通, 系统版本可能没有配置网络:
博客园有很多CentOs配置网络的文章自己去搜索一下。。
安装.Net core2.0,创建测试Asp.net Core应用程序:
按照官网来就行,不再赘述:
https://www.microsoft.com/net/learn/get-started/linux/rhel#install
正式部署项目:
查看主机IP
使用FTP上传程序包到Linux
打开终端->找到项目根目录->执行 dotnet xxx.web.dll ,这个xxx.web.dll是指你的web应用程序集。
搞定!
使用:IP+端口访问去吧。
部署之Docker
待续....
Windows下部署asp.net core 2.0 之 Kestrel
如果没有运行环境,请去下载: https://www.microsoft.com/net/learn/get-started/windows
打开cmd,使用cd /d c:\xxxpatn 命令 找到发布的项目根目录;运行dotnet xxx.web.dll,这个xxx.web.dll是指你的web应用程序集。
没有问题的话看下面
本地访问:http://localhost:5000
使用Nginx反向代理服务器映射端口到80:
下载:http://nginx.org/en/download.html 安装
配置 \conf\nginx.conf 文件
#user nobody;
worker_processes 1; #error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info; #pid logs/nginx.pid; events {
worker_connections 1024;
} http {
include mime.types;
default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on;
#tcp_nopush on; #keepalive_timeout 0;
keepalive_timeout 65; #gzip on;
#配置服务器地址,可以有多台,localhost 为 服务名
upstream localhost {
server 127.0.0.1:5000 weight=1;
} server {
#侦听80端口
listen 80;
#服务名称必须和upstream后面的名称一致
server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; #location / {
# root html;
# index index.html index.htm;
#}
#指定访问时转发到哪里,localhost为服务名
location / {
proxy_pass http://localhost;
} #error_page 404 /404.html; # redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
} # proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#} # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
} # another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias; # location / {
# root html;
# index index.html index.htm;
# }
#} # HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost; # ssl_certificate cert.pem;
# ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on; # location / {
# root html;
# index index.html index.htm;
# }
#} }
配置好之后:我们cmd->cd /d Nginx目录->start nginx
访问 http://localhost 搞定!
Nginx其他命令:nginx -s stop 停止
Windows下部署asp.net core 2.0 之 IIS
待续....
Nginx 请求分发
待续....
linux centos7 和 windows下 部署 .net core 2.0 web应用的更多相关文章
- Ubuntu 下使用 Nginx 部署 .NET Core 2.0 网站
前言 本文介绍如何在 Ubuntu 16.04 服务器上安装 .NET Core 2.0 SDK.创建项目与发布,并使用 Nginx 部署 .NET Core 2.0 Web 项目. 安装 .NET ...
- Windows下部署ElasticSearch5.0以下版本
Windows下部署ElasticSearch分ElasticSearch5.0以上版本(包括5.0)和ElasticSearch5.0以下版本两种情况,这两种安装方式有很大不同.今天首先说Elast ...
- win10下ASP.NET Core 2.0部署环境搭建(转)
此文用于记录在win10环境下,新建的Asp.net Core 2.0 Web应用项目如何运行在IIS上 一.运行环境 操作系统: Window10 家庭中文版 版本 10.0.15063 版本 15 ...
- windows 下部署 .netcore 到 docker
前面我们演示了如何将 Asp.Net Core 程序部署到 iis 和 部署到 windows 服务.其实前面的都是铺垫,如何将 Asp.Net Core 站点部署到 docker 才是这个系列文章的 ...
- windows 下部署kafka 日记 转
windows 下部署kafka 日记 转一.下载去apache 的官网(http://kafka.apache.org/downloads.html)下载最新的二进制版的压缩包.目前的最新版本是ka ...
- .net core 2.2 部署CentOS7(5)部署.net core mvc
目录: .net core 2.2 部署CentOS7(1)安装虚拟机 .net core 2.2 部署CentOS7(2)给虚拟机安装CentOS7 .net core 2.2 部署CentOS7( ...
- windows 下部署 .netcore 到 windows service
接上一篇 <windows 下部署 .netcore 到 iis>,这一篇记录一下怎么将 Asp.Net Core 以 windows 服务的方式部署. 一.修改代码 其实也很简单,只要调 ...
- QT程序在windows下部署发布
转载:http://www.cnblogs.com/Fan_Fan/archive/2010/05/29/1746860.html QT程序在windows下部署发布 以下包括了部分网上收集的,以及q ...
- 关于在windows下部署发布QT程序的总结
原文请看:http://www.cnblogs.com/javaexam2/archive/2011/05/18/2632916.html 关于在windows下部署发布QT程序的总结 2008-06 ...
随机推荐
- [git] github 推送以及冲突的解决,以及一些命令
推送以及冲突的解决:(我的觉得先看完) (正常情况就是把修改的文件 git add 然后git commit 然后推送就行啦): 下面是一些命令 1.查看分支状态(查看所有:当前检出分支的前面会有星号 ...
- Yii2.0 rules常用验证规则
设置一个修改方法,但是save(),没有成功,数据修改失败,查了好久,一般情况就是不符合rules规则,而我没有设置rules规则,重新设置了一个不能为空,然后就修改成功,rules里面什么也不写,也 ...
- SpringCloud(五)学习笔记之Hystrix
在微服务架构中多层服务之间会相互调用,如果其中有一层服务故障了,可能会导致一层服务或者多层服务故障,从而导致整个系统故障.这种现象被称为服务雪崩效应. Hystrix组件就可以解决此类问题,Hystr ...
- 域名和服务器绑定及https协议更换
服务器是之前已经购买了的 1.腾讯云产品中搜索域名注册(产品太多了懒得找,直接搜索来得快些) 2.进去之后可以选择各种后缀的域名,输入自己喜欢的,看看哪些后缀是没有被注册的.自己挑选一个就可以,按照指 ...
- Elasticsearch 集群部署
本文部署环境 $ cat /etc/redhat-release CentOS Linux release (Core) 部署前系统优化 $ /etc/security/limits.conf roo ...
- CSS躬行记(7)——合成
在图形编辑软件中,可以按特定地方式处理不同图层的合成,最新的CSS规范也引入了该功能,并提供了mix-blend-mode和background-blend-mode两个属性.混合模式(blendin ...
- 学习web前端的免费12个学习网站,等你来撩
我相信很多人刚喜欢web前端或者刚刚接触web前端的时候,都不愿意去花钱去培训或者买资料去学习,因为不知道自己会不会学好,或者只是一时脑热,所以就选择免费的去学习基础.编程学习 很多人包括一些企业家, ...
- 关于vagrant环境下项目中图片缓存的问题
之前用的是iis所以可能没有这些问题,后来换了nginx之后发现图片缓存问题很严重,本项目用的是thinkphp5框架:浏览器.runtime.session.cookie.加参数,后台,所有缓存都清 ...
- 2019-2020-1 20199329《Linux内核原理与分析》第六周作业
<Linux内核原理与分析>第六周作业 一.本周内容概述: 学习系统调用的相关理论知识,并使用库函数API和C代码中嵌入汇编代码两种方式使用getpid()系统调用 学习系统调用syste ...
- 2019-2020-1 20199328《Linux内核原理与分析》第六周作业
使用gdb跟踪分析一个系统调用内核函数 首先我们删除本身的menu目录,并从github上克隆一个menu,并进行编译 编译过程 现在找到test.c文件,加入上个实验中做的getPid()方法 利用 ...