只是记录自己发布若依分离系统到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 '<' 
相关推荐
草莓熊Lotso6 小时前
【Redis 初阶】Set 类型深度解析:去重集合的运算能力与实战场景
linux·网络·数据库·windows·redis·tcp/ip·缓存
张文君6 小时前
ubuntu26.04坏道坏块分区隔离急速版260831-V0.12
linux·python
IT大白鼠6 小时前
Docker 实战 ELKF 日志监控:容器日志全栈收集分析方案
运维·docker·容器
贝锐15 小时前
从国产化信创设备到商用安卓终端,向日葵如何帮助企业实现统一运维管理?
linux·运维·远程控制
Julien200416 小时前
调查和解决 SELinux 问题
linux·运维·服务器·网络·学习方法
天远Date Lab17 小时前
零信任架构实战:基于天远双人婚姻评估查询构建自动化房产按揭联合审查网关
运维·人工智能·架构·自动化
2601_9620746818 小时前
自己编译RustDesk,并将自建ID服务器和key信息写入客户端
运维·服务器
小张同学a.18 小时前
Docker 容器实战 1—— docker 基础与镜像构建
linux·运维·docker·容器
大模型丫丫19 小时前
Hermes Agent:轻量级智能体框架实战指南
大数据·运维·服务器
考虑考虑20 小时前
kubectl命令
运维·后端·自动化运维