We are using tomcat version 7
(with front end Apache
) and we have following configuration at setenv.sh file
我们使用的是tomcat版本7(带有前端Apache),我们在setenv.sh文件中进行了以下配置
JAVA_OPTS="$JAVA_OPTS -Dserver.proxy.name="www.example.com"
Currently i have add one more domain name www.foo.com
and point to same tomcat (Multiple domain name for same tomcat)
目前我已经添加了一个域名www.foo.com并指向相同的tomcat(同一个tomcat的多个域名)
but when i type www.foo.com
it will automatic convert in www.example.com in browser search bar.
但是当我输入www.foo.com时,它会在www.example.com中自动转换为浏览器搜索栏。
But if i change following setting in setevn.sh
file it works for foo but not for example
但是,如果我在setevn.sh文件中更改以下设置,它适用于foo但不是例如
JAVA_OPTS="$JAVA_OPTS -Dserver.proxy.name="www.foo.com"
Question:
题:
is there a way i can use multiple domain name to point on same tomcat like Alias
? what is -Dserver.proxy.name
?
有没有办法可以使用多个域名指向同一个tomcat,如Alias?什么是-Dserver.proxy.name?
1 个解决方案
#1
1
If you're using Apache in front specify virtualhosts with proxies to your tomcats. Don't even bother trying to accomplish this down in your application srever. Ideally you'd use something like the mod_jk Apache module for load balancing.
如果您在前面使用Apache,请指定虚拟主机与您的tomcats的代理。甚至懒得试图在你的应用程序中做到这一点。理想情况下,您可以使用mod_jk Apache模块之类的东西进行负载平衡。
#1
1
If you're using Apache in front specify virtualhosts with proxies to your tomcats. Don't even bother trying to accomplish this down in your application srever. Ideally you'd use something like the mod_jk Apache module for load balancing.
如果您在前面使用Apache,请指定虚拟主机与您的tomcats的代理。甚至懒得试图在你的应用程序中做到这一点。理想情况下,您可以使用mod_jk Apache模块之类的东西进行负载平衡。