如何使用Tomcat Web服务器在Internet上发布JSP项目? [英] How to publish a JSP project on the Internet using Tomcat web server?

查看:146
本文介绍了如何使用Tomcat Web服务器在Internet上发布JSP项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Tomcat Web服务器从我的PC在Internet上发布我的JSP项目. 我怎样才能做到这一点?

I want to publish my JSP project on the Internet from my PC using Tomcat web server. How can I do that?

推荐答案

这就是我要这样做的方式.

Here's how I would do it.

我会去dyndns.org并获得一个 免费的,人为的主机名和DNS 项.

I would go to dyndns.org and get a free, contrived host name and DNS entry.

我会在我的网站上建立dyndns代理 机器以保持IP为最新.

I would set up the dyndns agent on my machine to keep the IP up to date.

这两个步骤将为您提供一个互联网主机名",任何人都可以查找.

These 2 steps will give you a an "internet host name" that anyone can look up.

然后,我将DSL路由器的防火墙配置为从外部通过端口80.

Then I would configure my DSL router's firewall to let through port 80 from the outside.

现在,您在"Internet"上有一个实时端口80. (请注意,这是假设您的ISP允许您这样做.)

Now, you have a live port 80 "on the internet". (Mind, this assumes your ISP lets you do this.)

现在,您在计算机上安装了Tomcat,并将其配置为使用端口80.

Now, you install Tomcat on your machine, and configure it to use port 80.

然后,将WAR放到Tomcats/webapps中并启动Tomcat,并且您的应用程序现在已在公共Internet上发布.

Then you drop your WAR in to Tomcats /webapps and fire up Tomcat, and your app is now published on the public internet.

完成后,请确保关闭防火墙上的端口80.

When you're done, make sure that you close down port 80 on your firewall.

如果您要使用另一个端口(例如8080),则可以在相同的过程中使用不同的端口.

If you want to use another port (8080, say), that's fine to, same process, just a different port.

我过去曾经这样做过,它对我的​​ISP和路由器来说是一个桃子.

I have done this in the past and it has worked a peach for me with my ISP and router.

编辑-

我应该注意,由于您位于路由器防火墙的内部",因此您无法通过该主机名访问自己的服务器的可能性很高. ROUTER是具有实际外部IP的设备,而不是您的计算机.您的计算机的IP地址类似10.0.0.x.不过,您仍然可以通过localhost访问本地服务器

I should note that odds are high that you will not be able to access your own server via this host name, since you are on the "inside" of your routers firewall. The ROUTER is the device with the actual external IP, not your machine. You machine has something like 10.0.0.x for an IP. You can still access your local server via localhost, however

这篇关于如何使用Tomcat Web服务器在Internet上发布JSP项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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