只是记录自己发布若依分离系统到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 '<' 
相关推荐
夜之眷属33 分钟前
PriorityQueue:for-each 遍历和 poll 取出,顺序一样吗?
java·服务器·数据结构·后端·算法
信可维36 分钟前
自动化操作多平台账号:登录态、双会话与 User Data 的 3 个坑
运维·自动化
龙仔72543 分钟前
RustDesk 自建服务器 Key 强校验配置笔记
运维·服务器·笔记
大侠归来1 小时前
Docker 部署 Dolibarr:从零开始的完整指南
运维·docker·容器
KING-WU5121 小时前
Linux GDB 调试实战指南:从编译到断点调试
linux·运维·服务器
Lucis__1 小时前
深入理解程序链接与加载—从动静态链接到库加载
linux·elf·链接·程序·动静态库
傲世仙尊1 小时前
类和对象中-构造函数与析构函数把初始化清理自动化
java·运维·自动化
七月吃橘子2 小时前
WSL2+Docker+Ollama,本地部署大模型实践(Qwen1.8b)
运维·docker·容器
贵州诚鑫致达科技有限公司2 小时前
PVID 是什么?端口参数三身份
服务器·经验分享
影视飓风TIM2 小时前
Linux 进程信号原理与剖析
linux·运维·服务器