如何将 Eclipse Web 项目放到真实世界的服务器上?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6794558/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 16:41:27  来源:igfitidea点击:

How to put a eclipse web project onto a real world server?

javaeclipselive

提问by molleman

I have never placed anything on a web server.

我从来没有在网络服务器上放置任何东西。

i have a dynamic web project built in eclipse using servlets (using tomcat 7) that connects to a mysql database that is on a computer that is on my college network.

我有一个使用 servlet(使用 tomcat 7)在 Eclipse 中构建的动态 Web 项目,该项目连接到我大学网络上的计算机上的 mysql 数据库。

How would i go about placing this project onto a Web Server so i can access it from anywhere. If you could explain the best and cheapest option that would be great

我将如何将此项目放置到 Web 服务器上,以便我可以从任何地方访问它。如果你能解释最好和最便宜的选择,那就太好了

what would be the steps involved to make this project go live?

使这个项目上线所涉及的步骤是什么?

回答by Michael J. Lee

Amazon EC2has freemicro instance that will run tomcat+mysql! It's worth checking out!

Amazon EC2免费的微型实例,可以运行 tomcat+mysql!值得一试!

613 MB of memory and 32-bit and 64-bit platform support

613 MB 内存和 32 位和 64 位平台支持

回答by AlexR

If you are independent vendor you have 2 possibilities.

如果您是独立供应商,您有两种可能性。

First, take computer, connect it to network, install tomcat and mysql on it, deploy your web application, buy fixed IP, buy domain name and enjoy.

首先,拿起电脑,连接网络,在上面安装tomcat和mysql,部署你的web应用程序,购买固定IP,购买域名并享受。

Second way is find hosting company that hosts java applications and provides mysql service. There are a lot of such companies. If you choose one you pay them money and they do everything for you. I believe that if you need java and mysql you will not find free hosting company. But try. Probably there are such companies that will provide service for free and add a couple of their banners to your site.

第二种方法是找到托管java应用程序并提供mysql服务的托管公司。有很多这样的公司。如果你选择一个,你付钱给他们,他们会为你做一切。我相信,如果您需要 java 和 mysql,您将找不到免费的托管公司。但是试试吧。可能有这样的公司会免费提供服务,并在您的网站上添加一些横幅。

And yet another way is to buy virtual machine from for example Amazone cloud. You can buy the simplest linux machine. Install java+tomcat+mysql on it. Buy domain name and you are done. It is not free but it costs several cents an hour, so probably this will be the best way for you.

还有一种方法是从例如 Amazone 云购买虚拟机。你可以买最简单的linux机器。在上面安装java+tomcat+mysql。购买域名,您就完成了。它不是免费的,但每小时要花几美分,所以这可能是您的最佳方式。

回答by Costis Aivalis

In order to deploy your war file, all you need to do is copy it to the apache-tomcat webapps directory. Tomcat will open it up for you automatically, and your application is up and running.

为了部署您的 war 文件,您需要做的就是将它复制到 apache-tomcat webapps 目录。Tomcat 会自动为您打开它,您的应用程序就会启动并运行。

Do not forget to make your jdbc jar file available to tomcat.

不要忘记让你的 jdbc jar 文件对 tomcat 可用。

Hosting starts at around $2.45 per month. We have had great experience with MochaHost.

托管起价约为每月 2.45 美元。我们在MochaHost方面拥有丰富的经验。

You could host it yourself on a system, even if you only have a dynamic IP, using DynDNS.org, but keeping a server up 24/7/365 involves a lot of work.

您可以自己在系统上托管它,即使您只有一个动态 IP,使用DynDNS.org,但保持服务器 24/7/365 运行需要大量工作。

回答by Vishal

For your reference:

供你参考:

You can check out with http://www.hostjava.netthey have pretty decent hosting plans with tomcat and mysql.

你可以通过http://www.hostjava.net 查看他们有相当不错的 tomcat 和 mysql 托管计划。

回答by Vishal

Once you create the WAR file as Jeremy instructed, you will just drop it in the webapps folder of the Tomcat installation.

按照 Jeremy 的指示创建 WAR 文件后,您只需将其放到 Tomcat 安装的 webapps 文件夹中即可。

回答by user3217635

So that you can deploy your file, all you have to do is copy it for the apache-tomcat webapps directory. Tomcat will open it up in your case automatically, as well as your application is up and running.

这样您就可以部署您的文件,您所要做的就是将它复制到 apache-tomcat webapps 目录中。Tomcat 会在您的情况下自动打开它,并且您的应用程序已启动并正在运行。

Do not forget to build your jdbc jar file open to tomcat.

不要忘记构建对 tomcat 开放的 jdbc jar 文件。

Hosting starts at about $3.95 per month. We now have had great experience with HostMyth.

托管起价约为每月 3.95 美元。我们现在对HostMyth有了很好的体验。

You might host it yourself on something, in case you only have an engaged IP, using cloudflare, but keeping a server up 24/7/365 involves lots of work.

你可以自己托管它,以防你只有一个参与的 IP,使用 cloudflare,但保持服务器 24/7/365 全天候运行需要大量工作。