简体   繁体   English

如何在远程服务器中部署Struts2应用程序

[英]How to deploy Struts2 application in remote server

I have developed a java web application using Struts2 in eclipse. 我已经在Eclipse中使用Struts2开发了一个Java Web应用程序。 I run the application by using this url 我通过使用此URL运行应用程序

http://localhost:8080/newApp

application run on the local machine in tomcat server, but I want to run it on a remote server using a url something like this. 应用程序在tomcat服务器中的本地计算机上运行,​​但是我想使用类似这样的url在远程服务器上运行它。

http://myapp.com/newApp

How to do this deployment? 该如何部署? What is the server requirements to do this and any tutorial would be appreciated. 服务器对此有什么要求,任何教程都将不胜感激。 I want the application to be in a remote server so that remote clients can access the application. 我希望该应用程序位于远程服务器中,以便远程客户端可以访问该应用程序。

If you want to access your local server then download a web server eg Apache HTTP Server . 如果要访问本地服务器,请下载Web服务器,例如Apache HTTP Server Install and configure a Virtual Host as myapp.com to map localhost:8080 server. 安装虚拟主机并将其配置为myapp.com以映射localhost:8080服务器。 Once done, you can access your application using http://myapp.com/newApp URL. 完成后,您可以使用http://myapp.com/newApp URL访问您的应用程序。 This way, you are still accessing your application locally. 这样,您仍在本地访问您的应用程序。

If you want your application to be accessible from anywhere on the Internet , you need to have a similar server (I guess you are using WebLogic ) available on the Internet connected server and you may get DNS alias created for the naming of the URL. 如果您希望可以从Internet上的任何位置访问您的应用程序,则需要在连接Internet的服务器上有一个可用的类似服务器(我想您正在使用WebLogic ),并且可能会为URL的命名创建DNS别名。 There are several service provider in the industry, who provide application hosting services with/without some fee. 行业中有多家服务提供商,他们提供有/没有一定费用的应用程序托管服务。 You may want to evaludae that as well. 您可能还需要对此进行评估。

Q: how to deploy struts2 application in remote server? 问:如何在远程服务器上部署struts2应用程序?

A: The specifics of deploying an application depend entirely on what kind of server you're using. 答:部署应用程序的细节完全取决于您使用的服务器类型。 Here is an example for WebSphere: 这是WebSphere的示例:

And here is an example for JBoss: 这是JBoss的示例:

您可以使用jboss部署应用程序Jboss Web配置

The act of deploying a Struts application will necessitate that you can transfer you application across to it so you will need sftp and ssh running on the remote machine. 部署Struts应用程序的行为需要您可以将应用程序迁移到该应用程序,因此您将需要在远程计算机上运行sftpssh

Then you will need the application server of your choice running there; 然后,您需要在其中运行您选择的应用程序服务器; candidates servers would include Tomcat, JBoss, Weblogic from Oracle WebSphere from IBM. 候选服务器包括Tomcat,JBoss,IBM的Oracle WebSphere的Weblogic。

If you want to practice deployment you could make use of VirtualBox and Vagrant to create a Virtual Machine on a local PC where you can install the application servers that you decide upon and practise deploying your app. 如果要练习部署,则可以利用VirtualBox和Vagrant在本地PC上创建虚拟机,您可以在其中安装自己决定的应用程序服务器并练习部署应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM