我的服务器机器上有一个 tomcat 6.0 网络服务器。现在我在同一台机器上创建了一个 glassfish 服务器。为了避免端口冲突,我只是将 glassfish 端口更改为 8081。现在我如何从不同的 DNS 名称访问我在 glassfish 和 tomcat 上的 Web 应用程序。
最佳答案
取决于您的 DNS/服务器设置。
- 您可以使用 Apache 和反向代理:
<VirtualHost *> ProxyPreserveHost On # Servers to proxy the connection, or; # List of application servers: # Usage: # ProxyPass / http://[IP Addr.]:[port]/ # ProxyPassReverse / http://[IP Addr.]:[port]/ # Example: ProxyPass / http://0.0.0.0:8081/ ProxyPassReverse / http://0.0.0.0:8081/ ServerName glassfish.server </VirtualHost> <VirtualHost *> ProxyPreserveHost On # Servers to proxy the connection, or; # List of application servers: # Usage: # ProxyPass / http://[IP Addr.]:[port]/ # ProxyPassReverse / http://[IP Addr.]:[port]/ # Example: ProxyPass / http://0.0.0.0:8080/ ProxyPassReverse / http://0.0.0.0:8080/ ServerName tomcat.server </VirtualHost>
- 或者您可以使用您的 DNS。恐怕我帮不了你。
关于java - Glassfish 和 Tomcat 在同一台服务器机器上并在两台机器上托管多个站点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23285649/