欢迎光临
我们一直在努力

vue项目怎么搭建到云服务器上

链接1:https://blog.csdn.net/qq_37741554/article/details/87560823  linux下载安装node.js

 链接2:https://blog.csdn.net/qq_30591163/article/details/82458846 linux环境nginx部署vue项目

1,首先,将vue项目打包(打包文件为dist,里面放着打包好的css,js,index.html文件),打包前先把IP地址改好(port改了其实没用,访问端口号是看nginx里配置的端口号)!!!

2,将dist文件放到服务器上(我放置在nginx同级目录下)

配置nginx conf下的nginx.conf,怎么配置多个虚拟主机(即多个监听访问端口)https://www.cnblogs.com/yszr/p/10468525.html

#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; server { #eg:47.98.32.14:80就可以访问对应的项目了 listen 80; # 监听(访问)端口 注意:这里是nginx服务器要占用的端口,不是你后台项目运行的端口,千万不能一样(其实这里就是填写访问端口!!!) server_name _; # _代表匹配所有(这里最好填写你的ip地址) root /usr/local/nginx/dist/; # 站点根目录 index index.html; } }

 

3,安装nginx(参考随笔—-云服务器搭建)

4,修改nginx.conf配置文件

5,访问页面咯  http://ip:port

赞(0)
版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
文章名称:vue项目怎么搭建到云服务器上
文章链接:https://www.jmwz.net/6513.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址