【问题标题】:Configure apache to point domain to tomcat webapps root配置 apache 以将域指向 tomcat webapps root
【发布时间】:2018-07-09 20:01:35
【问题描述】:

我有一个使用 tomcat8 和 apache2 的基于 Java 的 Web 应用程序。如果我通过 IP 地址访问我的网站,它会显示位于 /opt/tomcat/webapps 中的应用程序。但是,如果我尝试通过它的域名访问我的网站,它会将我定向到位于 /var/www/html/index.html 的默认 apache2 页面(这并不奇怪,因为 DocumentRoot 设置为 /var/www/html我的虚拟主机,见下文)。

指向tomcat webapps根目录的正确方法是什么?我需要使用 JkMount 吗?

<IfModule mod_ssl.c>
    <VirtualHost _default_:443>
            ServerAdmin webmaster@localhost
            ServerName mywebsite.com
            DocumentRoot /var/www/html

【问题讨论】:

  • 似乎 DocumentRoot 仅适用于静态内容。也许我需要为 tomcat 服务器设置一个反向代理。

标签: java apache2 tomcat8


【解决方案1】:

我通过在 Apache 中配置反向代理来为我的 tomcat 应用程序提供服务解决了这个问题。 https://wiki.apache.org/httpd/TomcatReverseProxy

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-10-29
    • 1970-01-01
    • 1970-01-01
    • 2011-09-29
    • 2021-02-04
    • 2013-09-05
    • 1970-01-01
    • 2019-08-11
    相关资源
    最近更新 更多