试图用8080端口掩盖Tomcat地址的域地址

发布于 2025-02-12 06:50:15 字数 739 浏览 0 评论 0 原文

我想拥有一个Intranet网站,以至于 有一台具有静态IP地址的机器:192.168.88.80 通过主机文件映射到域: www.example.com 然后,我想映射一个地址,以便在浏览器地址栏中输入以下内容时: http://app.example.com 它在 http://www.example.com:8080/app 但是地址栏仍然显示 http://app.example.com 我尝试了几种组合,但无法配置。我不断得到 http://www.example.com:8080/app 。 有人有任何想法吗,最好使用apache httpd 谢谢

I want to have an intranet site such that
There is a machine with static IP address: 192.168.88.80
Mapped via hosts file to domain: www.example.com
Then I want to map an address such that when I enter the following in browser address bar: http://app.example.com
It loads my Tomcat hosted application at http://www.example.com:8080/app but address bar still displays http://app.example.com
I have tried several combinations but not able to configure such. I keep getting http://www.example.com:8080/app in my browser bar.
Does anyone have any idea, preferably using Apache httpd
Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

恏ㄋ傷疤忘ㄋ疼 2025-02-19 06:50:18

您可以使用Apache HTTPD和Tomcat通过使用reverseproxy设置

  1. 取消点击Apache的httpd.conf文件中的适当行,以启用Apache mod_proxy和mod_proxy_http模块

    loadModule proxy_module模块/mod_proxy.so

    loadModule proxy_http_module模块/mod_proxy_http.so

  2. anpache ap httpd.conf文件末尾的ProxypassReverse条目。

    proxypass/样本http:// localhost:8080/sample

    proxypassReverse/示例http:// localhost:8080/sample

参见 https://www.theserverside.com/blog/coffee-talk-java-news-news-stories-and-andiores-and-opinions/how-to-configure-apache-apache-as-a-a-a-res-resverse-proxy-proxy-example 有关更多详细信息

You can achieve this using apache httpd and tomcat by using the reverseProxy settings

  1. Uncomment the appropriate line in Apache’s httpd.conf file to enable the Apache mod_proxy and mod_proxy_http modules

    LoadModule proxy_module modules/mod_proxy.so

    LoadModule proxy_http_module modules/mod_proxy_http.so

  2. add an Apache proxypass and an Apache proxypassreverse entry at the end of the httpd.conf file.

    ProxyPass /sample http://localhost:8080/sample

    ProxyPassReverse /sample http://localhost:8080/sample

See https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/How-to-configure-Apache-as-a-reverse-proxy-example for more details

魂牵梦绕锁你心扉 2025-02-19 06:50:18

解决此问题的最简单方法,没有任何额外的软件,是在端口80上运行tomcat ,该将修复8080的部分,并将您的战争文件命名为root.war,war,该文件解决上下文部分( App 在URL中)。

The simplest way to address this, without any extra software is, is to run Tomcat on port 80, which will fix the 8080 part, and to rename your war file to ROOT.war, which address the context part (the app in the URL).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文