端口80上的Tomcat Webapp [英] Tomcat Webapp on port 80

查看:65
本文介绍了端口80上的Tomcat Webapp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的tomcat服务器上有一个webapp,如下所示:

I have a webapp on my tomcat server like this:

mydomain.com:8080/mywebapp

然后,我连接到我的Web应用程序,并且它可以正常工作,但是我想要的是这样查看我的Web应用程序:

Then I connect to my webapp, and it is working correctly, but what I want is to see my webapp like this:

mydomain.com

所以我不想只在端口80上安装tomcat,我不想通过其名称访问我的webapp,我想使用我的域URI直接连接.

So I don't want only tomcat on port 80, I don't want to access my webapp through its name, I want to connect directly using my domain URI.

我该怎么做?我希望它能与Linux(Ubuntu 12.04 LTS)和Windows服务器一起使用.

How can I do this? I want this to work with Linux (Ubuntu 12.04 LTS) and Windows servers.

推荐答案

有几种方法可以实现此目的,但是最常见的解决方法是将Apache作为其前面的反向代理运行.您可以在此处找到一些详细信息.这将在Linux和Windows上均适用.对于Linux,您还可以使用 authbind 允许Tomcat绑定到端口80.只是将 server.xml 中的端口更改为 80 不会在Linux中工作,因为这需要您以 root 的身份启动Tomcat.这不是一个好主意.

There are several ways to achieve this, but the most common way to solve it is to run Apache as a reverse proxy in front of it. You can find some details here. This will work on both Linux and Windows. For Linux, you can also use authbind to allow Tomcat to bind to port 80. Just changing the port to 80 in your server.xml will not work in Linux, since it would require you to start Tomcat as root, which is not a very good idea.

此外,要使Web应用程序位于/,您可以将war文件部署为 ROOT.war .

Also, to have your webapp at /, you can deploy your war file as ROOT.war.

这篇关于端口80上的Tomcat Webapp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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