gpt4 book ai didi

带 tomcat 的 Apache Web 服务器

转载 作者:行者123 更新时间:2023-11-28 22:11:27 24 4
gpt4 key购买 nike

我们有一个带有 gradle 构建配置的 java web 应用程序,其中包含 2 个模块,如下所示:

  1. project-web.war -- 包含所有 statc 文件、js、jsp 等。它还包含所有项目、带有 rest Controller 层的 spring 配置。

  2. project-main.jar -- 包含所有业务和 DAO 层逻辑。

目前我们正在 Apache tomcat 中部署这两个模块。我们的项目正在进行一些架构更改,其中一项要求是在 Apache 服务器中添加所有静态内容,以便可以快速提供静态内容。

我是 Apache http 网络服务器方面的初学者。我有以下问题:

  1. 如果我将所有静态内容都放在 Apache http 服务器中,那么我可以从 project-web 中删除所有静态内容吗?这两个项目可以单独存在吗?

  2. 今后,项目的静态内容将位于 Apache http 网络服务器中,网络应用程序将部署在 Apache tomcat 中,此外,这两个服务器将位于不同的虚拟机中。 tomcat中的web应用如何访问不同VM机器上的Apache web服务器的静态内容?(例如jsp如何指向图片?)

  3. 为静态内容创建一个单独的项目是否是个好主意,因为它在未来将独立于 Web 项目并且只需要部署在 Apache http 服务器中?

上述问题的答案将是可观的,也欢迎其他相关建议。谢谢!

最佳答案

1) If I put all the static contents in Apache http server, then can I remove all the static contents from project-web?

是的。

Can both of these project exist separately?

他们可以,但是永远(不应该)访问 webapp 中的内容,那有什么意义呢?

2) Going forward static content of project will be in Apache http web server and web app will be deployed in Apache tomcat, in addition both of these server will be in different VM machine. How web app in tomcat can access static content from Apache web server in different VM machine?(E.g. how jsp can point to images?)

网络应用不需要访问图像。浏览器需要访问图像。可以设置 Apache HTTPD 配置以透明地处理该问题,而无需更改任何 JSP。

3) Would it be fine idea to create a separate project for just static content as it will independent of web project in future and just need to be deployed in Apache http server?

是的。

关于带 tomcat 的 Apache Web 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40334977/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com