且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

尽管不再支持 TomCat,如何在 Plesk Onyx 17.8 中部署 .war 文件?

更新时间:2023-11-17 22:17:04

1.想法

改用 Tomcat Docker 容器并在映射的 Docker 卷中部署 .war 文件.

1. Idea

Use a Tomcat Docker container instead and deploy your .war file in a mapped Docker volume.

  • 从扩展目录(主页 -> 服务器管理 -> 扩展 -> 搜索文本框)安装 Plesk 扩展Docker".
  • 打开 Docker 扩展(主页 -> 服务器管理 -> Docker).
  • 安装 Tomcat 容器(搜索文本框 -> 'run' 下拉框)
  • 适配Tomcat容器配置
    • 激活系统重启后自动启动"
    • 停用自动端口映射"
    • 对于Manual mapping",选择8080 to external 8080端口配置
    • Install the Plesk extension "Docker" from the extension catalog (Home -> Server Management -> Extensions -> search textbox).
    • Open the Docker extension (Home -> Server Management -> Docker).
    • Install the Tomcat container (search textbox -> 'run' drop down box)
    • Adapt the Tomcat container configuration
      • activate "Automatic start after system reboot"
      • deactivate "Automatic port mapping"
      • for the "Manual mapping" choose a 8080 to external 8080 port configuration
      • /usr/local/tomcat/webapps//usr/local/tomcat/webapps/
      • /usr/local/tomcat/logs//usr/local/tomcat/logs/
      • /usr/local/tomcat/webapps/ to /usr/local/tomcat/webapps/
      • /usr/local/tomcat/logs/ to /usr/local/tomcat/logs/

      第一个卷映射在主机系统(您的服务器)上提供一个目录,该目录与 Tomcat 容器内的 webapps 目录同步.将您的 .war 文件复制到其中将在 Tomcat 容器中部署它.第二个卷映射向您的主机系统提供 Tomcat 容器内部日志文件.

      The first volume mapping provides a directory on the host system (your server) which is synchronized with the webapps directory within the Tomcat container. Copying your .war file into it will deploy it at the Tomcat container. The second volume mapping provides the Tomcat container internal log files to your host system.