如何从 Apache 重定向到 Tomcat? [英] How do I redirect from Apache to Tomcat?

查看:111
本文介绍了如何从 Apache 重定向到 Tomcat?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发我的第一个 Java 站点.我在端口 8080 上运行 Apache Tomcat,在端口 80 上运行 Apache HTTPD.我可以访问该站点的当前 URL 是(例如)123.4.5.6:8080.我想在将域指向新 IP 之前删除 URL 中的端口号.

I'm working on my first Java site. I'm running Apache Tomcat on port 8080, and Apache HTTPD on port 80. The current URL that I can access the site at is (for example) 123.4.5.6:8080. I want to remove the port number from the URL before I point the domain at the new IP.

目前我只将 Apache 用于 phpmyadmin,但是一旦我弄清楚 mod_jk 等,我计划将它用于 CGI 脚本和其他东西......所以我不想改变Tomcat 的端口为 80 并关闭 Apache.

At the moment I am only using Apache for phpmyadmin, however I plan on using it for CGI scripts and other stuff once I figure out mod_jk etc... So I don't want to change Tomcat's port to 80 and turn off Apache.

我希望这是有道理的.

推荐答案

正确的做法是让 Apache 80 和 Tomcat 8080 并使用插件(最好是 mod_proxy)从 Apache 代理 Tomcat.mod_proxy 只需 10 分钟即可完成设置.

The correct way to do things is to leave Apache at 80 and Tomcat at 8080 and use a plug in (preferably mod_proxy) to proxy Tomcat from Apache. mod_proxy would only take you 10 minutes to set up.

这个操作方法非常易于遵循.

这篇关于如何从 Apache 重定向到 Tomcat?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆