阿里服务器部署学习

1.部署vue build之后的dist包

  1. 申请免费阿里服务器
  2. 电脑远程桌面连接服务器公网ip
  3. 上传dist(public:‘./’)包到桌面或者合适位置
  4. 使用宝塔面板,软件商店,nginx配置location root,之后重启;可以设置多个location ,部署多个项目,如下:如果使用vue router需要local配置下
  5. location / {
    root C:\Users\Administrator\Desktop\dist;
    try_files $uri $uri/ @router;
    index index.html index.htm;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection “upgrade”;
    }
    location /yjj {
    alias C:\Users\Administrator\Desktop\websocket2;
    try_files $uri $uri/ @router;
    index index.html index.htm;
    }
    location /yjl {
    alias C:\Users\Administrator\Desktop\websocket1;
    try_files $uri KaTeX parse error: Expected 'EOF', got '}' at position 53: … index.htm; }̲ location /… /index.html last;
    }

你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Markdown编辑器, 可以仔细阅读这篇文章,了解一下Markdown的基本语法知识。

2.部署node项目

  1. 上传完整的node项目,包括启动.js文件,package.json,node_module
  2. 宝塔软件商店安装pm2,选择.js打开
  3. 根据端口号配置阿里云服务器安全组规则,开放此端口,如下:
  4. 在这里插入图片描述
    在这里插入图片描述

3.实现前端websocket和node中websocket

<script>

export default {
   
  name: 'websocketTest',
  data 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值