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