开发者

How to publish a JSP project on the Internet using Tomcat web server?

开发者_JAVA百科

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.

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

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.

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

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

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

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

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

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

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

Edit -

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


Pack your project in xx.war, then put it in Tomcat's /webapps folder. You could then visit it at http://localhost:8080/your_project_name

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜