链接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

最新文章

  1. ArcGis for Android 工作与学习
  2. 1、jvm的体系结构
  3. Window 端口查询
  4. [zz] JIT&HotSpot
  5. python 关于 ImportError: No module named 的问题
  6. Longest Repeated Sequence【微软编程一小时-题目2】
  7. MVC4.0 上传Excel并存入数据库
  8. Yii Framework2.0开发教程(4)在yii中定义全局变量
  9. 【嵌入式开发】嵌入式 开发环境 (远程登录 | 文件共享 | NFS TFTP 服务器 | 串口连接 | Win8.1 + RedHat Enterprise 6.3 + Vmware11)
  10. thinkphp 找数据库某个字段为空的数据,PHP 数据调取 空数据
  11. 关于python的正则表达式的例子
  12. [算法进阶0x10]基本数据结构A作业总结
  13. 各种平台的表达芯片跟mRNA-seq数据比较
  14. ASP.Net巧用窗体母版页
  15. FlexPaper:使用flash在线展示pdf
  16. c++ 匹配相邻元素相等的元素(adjacent_find)
  17. monkey初接触
  18. 【Java源码解析】ThreadLocal
  19. Java第三阶段学习(四、缓冲流)
  20. 判断IP是否为爬虫IP

热门文章

  1. LaTeX技巧007:每一章开始的header引用名言应该怎么做?
  2. [shell脚本] mysql服务启动脚本
  3. H5 使用input标签上传图片给后台
  4. Selenium3+python自动化013-操作浏览器的Cookie
  5. 避免layui form表单重复触发submit绑定事件
  6. 16day 路径信息系列
  7. python3爬虫(4)各种网站视频下载方法
  8. Weather
  9. html 动态生成
  10. 地铁合作(hjy)