只是记录自己发布若依分离系统到linux过程中遇到的问题

我遇到最大的问题:

1、如何打包war,在tomcat下的webapps能够正常访问。

2、vue的配置和nginx的配置。

一、JAVA端

1、修改配置文件,jar改为war。

2、修改Application文件

3、端口号修改为自己需要的。下面红框除了端口,其他三个都需要配置war包。不然我打包的war包非常大,并且放到tomcat下的webapps后,不解析。

4、修改配置文件中的端口号

5、修改tomcat配置文件,加入端口号。

6、启动tomcat。

7、打包方法。我是使用下面的打包方式:

如果使用package方式。出来的war包,tomcat解析不出来。可能是我没有找对方法。

二、VUE端

1、修改pro配置文件。

2、修改nginx配置文件:

复制代码
# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/

#user nginx;
user root;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;


server {
    listen 40003;
    server_name _;
    charset utf-8;

    # 前端项目根目录(正确写法)
    root /usr/share/nginx/html/dyt;
    index index.html;

    # 前端调用 /dyt/xxx → 自动转发到 41002 后端
    location /dyt/ {
        proxy_pass http://127.0.0.1:41003;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
	 # 3. 禁用缓存,强制走代理,不返回静态资源
        proxy_cache off;
        expires -1;
    }

    # 前端页面
    location / {
        try_files $uri $uri/ /index.html;
    }

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }
}


}

问题:有可能出现下面的问题,需要在上面的nginx配置文件中使用: user root;

复制代码
Uncaught SyntaxError: Unexpected token '<' 
相关推荐
荣--1 小时前
一键部署不是为了省时间 —— 它是把"买来的 PaaS"变成"自己的平台"的拐点
运维·zabbix·工程化·一键部署·平台化·边界设计
江华森2 小时前
动手实战学 Docker — 从零到集群编排完全指南
运维
Avan_菜菜18 小时前
FRP 内网穿透完整实战:从 HTTP 映射到 HTTPS 自签代理
运维·nginx·https
Sokach10151 天前
Linux Shell 脚本从零到能用:一个新手的一天学习总结
linux
SelectDB2 天前
Litefuse 开源并推出单进程轻量模式,25 秒就能跑起来的 Agent 可观测与评估平台
运维·后端·自动化运维
AlfredZhao2 天前
Docker 容器时区不对,`timedatectl` 不存在怎么办?
linux·timezone
zzzzzz3103 天前
9K Star 炸裂开源!这个 C 语言写的代码知识图谱,把 Linux 内核索引压缩到了 3 分钟
linux·服务器·sql
XIAOHEZIcode3 天前
Linux系统鼠标偏移常见原因以及修复方案
linux·运维·游戏
用户0328472220704 天前
如何搭建本地yum源(上)
运维
A小辣椒5 天前
TShark:Wireshark CLI 功能
linux