首页 > 解决方案 > 在多个 URL 上使用相同的 tomcat 实例

问题描述

我的服务器 opxxx01(FQDN:opxxx01.domain.com)上运行了一个 tomcat 实例,一切正常。但我想在另一个 URL 上显示相同的实例: quietude.anotherdomain.com

我阅读了很多关于此的主题,但对我没有任何帮助:

在 opxxx01.domain.com --> OK

在 quietude.anotherdomain.com --> KO

上下文:Red Hat Enterprise Linux Server release 7.4 (Maipo);雄猫 8.5.30;阿帕奇 2.4.6

您可以在下面看到我的代码,但 quietude.anotherdomain.com 上没有显示任何内容。

谢谢你的帮助 :)

<Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true">
    <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
        prefix="localhost_access_log" suffix=".txt"
        pattern="%h %l %u %t &quot;%r&quot; %s %b %S %D %F" />
    <Valve className="org.apache.catalina.valves.ErrorReportValve" showReport="false" showServerInfo="false" />
</Host>
<!-- I added these lines below -->
<Host name="quietude.anotherdomain.com"  appBase="webapps" unpackWARs="true" autoDeploy="true">
    <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
        prefix="quietude_access_log" suffix=".txt"
        pattern="%h %l %u %t &quot;%r&quot; %s %b %S %D %F" />
</Host>

标签: apachetomcat

解决方案


我终于找到了!

我的文件app.f2e312e439be13da8b85.js,我改变:

http://opxxx01.domain.com/downloads/quietude_result.csv

经过

/downloads/quietude_result.csv

在我的文件Statistics.vue中,我更改:

axios.get('http://opxxx01.domain.com/downloads/quietude_result.csv').then(response => {

经过

axios.get('/downloads/quietude_result.csv').then(response => {

推荐阅读