zoukankan      html  css  js  c++  java
  • 部署.Net Core APi+Vue 到 linux centos 服务器(一)

    部署.Net Core APi+Vue 到 linux centos 服务器(一)

    前言:项目采用的是 .net core 作为接口,vue作为前端。

    此时需要把整个项目架设到linux centos服务器上。

    架设之前需要装些环境。nginx core sdk等,工具用到 Fz(FTP上传软件),xshell(远程命令)

    那么接下来开始安装:

    一:上传vue项目
    
    准备工作:需要一个vue项目源码。这里就不说如何建立vue了。
    
    (1) npm run build 之后 打包好Vue项目,放到linux服务器上此处是用FTP软件上传不祥述)  /ur/pm路径下。
    
    二:安装nginx
    
    1. 安装依赖
    
    yum install gcc-c++
    yum install -y pcre pcre-devel
    yum install -y zlib zlib-devel
    yum install -y openssl openssl-devel
    2. 下载nginx,并解压
    
    wget -c https://nginx.org/download/nginx-1.13.1.tar.gz
    tar -zxvf nginx-1.13.1.tar.gz
    3. 使用默认配置执行,并编译安装
    
    /configure
    make
    make install
    4. 查找安装路径
    
    whereis nginx
    5. 启动 / 停止 nginx
    
    cd /usr/local/nginx/sbin/
    ./nginx 
    ./nginx -s quit
    6. 查看 nginx 启动或者结束进程
    
    ps aux|grep nginx 
    
    7.重启 nginx
     nginx -s reload
    
    9. nginx 启动之后进入配置文件进行配置
    
    vi /usr/local/nginx/conf/nginx.conf

      二 配置 nginx 

    打开conf之后,
    
    配置好 localhost 此处使用ip访问。 
    前端 vue 使用80端口, 
    后端 配置 locaiton /api {}  /api接口,经过5000端口。

    配置好 后 nginx -s reload 重写加载一下配置,生效。

     经过配置之后,前端的 vue项目,直接用ip就可以访问(如果端口占用,可以改用其他端口,或者杀死在用进程)。 

    后续配置 core api

      

  • 相关阅读:
    正则表达式
    JavaScript基础
    Servlet监听器
    Java EKT关键技术强化 tomcat中文乱码问题
    spring和springmvc 整合步骤
    [ERROR] [ERROR] Some problems were encountered while processing the POMs: [ERROR] 'packaging' with value 'war' is invalid. Aggregator projects require 'pom' as packaging. @ line 9, column 16
    Pagehelper的 使用
    异步 json的使用
    分页技术 PageHelper
    Exception encountered during context initialization
  • 原文地址:https://www.cnblogs.com/NotEnough/p/11609006.html
Copyright © 2011-2022 走看看