只是记录自己发布若依分离系统到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 '<' 
相关推荐
电商API_180079052479 分钟前
企业ERP进销存场景|京东商品详情接口自动同步方案|凭证鉴权批量调用技术实操
大数据·运维·人工智能·爬虫·数据挖掘·网络爬虫
张小姐的猫21 分钟前
【Linux】网络编程 —— HTTP协议(上)
linux·运维·服务器·网络·http·单例模式·策略模式
国科安芯21 分钟前
星间光链路:AS32S601型抗辐射MCU在空间激光通信终端控制中的技术实现
服务器·网络·单片机·嵌入式硬件·物联网·安全·信息与通信
小稻穗37 分钟前
市场调研样本选型坐标系:2026六家国内样本平台能力横向校验
大数据·运维·数据分析
栩栩云生1 小时前
AI 写代码犯的错,早被写进了错题集
linux·安全·ai编程
AOwhisky1 小时前
Python 学习笔记(第十三期)——运维自动化(下·前篇):远程命令执行——paramiko基础篇
运维·python·学习·云原生·自动化·运维开发·paramiko
AOwhisky1 小时前
Python 学习笔记(第十四期)——运维自动化(下·中篇):远程文件传输——paramiko进阶篇
运维·python·学习·云原生·自动化·文件传输·paramiko
imc.112 小时前
linux基础IO
linux·运维·服务器
躺不平的理查德2 小时前
让Ubuntu 的第二块网卡 ens37 永久固定为 192.168.30.111
运维·服务器
慧都小妮子2 小时前
ThingsBoard PE 智慧能源:打造企业数字化能源管理平台
运维·物联网·能源·数据采集·数据可视化·thingsboard·制造业数字化