如何在CentOS上运行 Java EE应用

How to run Java EE application on CentOS

我使用 EJB 和 JSF 创建了一个应用程序。

我想将我的应用程序部署到网络上,所以我从 hostgator 获得了一个专用服务器。在这台服务器上,我安装了 CentOS 6.7、Java 7 和 JBoss AS 7.1。

除此之外,我还有自己的域名。

如何将我的应用程序部署到此服务器以及如何通过我的域名访问此应用程序?

这是直接来自 JBoss 的信息:

[standalone@localhost:9999 /] deploy ~/Desktop/test-application.war
'test-application.war' deployed successfully.

[standalone@localhost:9999 /] undeploy test-application.war
Successfully undeployed test-application.war.

您也可以手动部署:

Basic workflows: All examples assume variable $AS points to the root of the JBoss AS 7 distribution.

A) Add new zipped content and deploy it:

cp target/example.war $AS/standalone/deployments/
(Manual mode only) touch $AS/standalone/deployments/example.war.dodeploy

B) Add new unzipped content and deploy it:

cp -r target/example.war/ $AS/standalone/deployments
(Manual mode only) touch $AS/standalone/deployments/example.war.dodeploy

C) Undeploy currently deployed content:

rm $AS/standalone/deployments/example.war.deployed

D) Auto-deploy mode only: Undeploy currently deployed content:

rm $AS/standalone/deployments/example.war

E) Replace currently deployed zipped content with a new version and deploy it:

cp target/example.war/ $AS/standalone/deployments
(Manual mode only) touch $AS/standalone/deployments/example.war.dodeploy

F) Manual mode only: Replace currently deployed unzipped content with a new version and deploy it:

rm $AS/standalone/deployments/example.war.deployed
wait for $AS/standalone/deployments/example.war.undeployed file to appear
cp -r target/example.war/ $AS/standalone/deployments
touch $AS/standalone/deployments/example.war.dodeploy

G) Auto-deploy mode only: Replace currently deployed unzipped content with a new version and deploy it:

touch $AS/standalone/deployments/example.war.skipdeploy
cp -r target/example.war/ $AS/standalone/deployments
rm $AS/standalone/deployments/example.war.skipdeploy

H) Manual mode only: Live replace portions of currently deployed unzipped content without redeploying:

cp -r target/example.war/foo.html $AS/standalone/deployments/example.war

I) Auto-deploy mode only: Live replace portions of currently deployed unzipped content without redeploying:

touch $AS/standalone/deployments/example.war.skipdeploy
cp -r target/example.war/foo.html $AS/standalone/deployments/example.war

J) Manual or auto-deploy mode: Redeploy currently deployed content (i.e. bounce it with no content change):

touch $AS/standalone/deployments/example.war.dodeploy

K) Auto-deploy mode only: Redeploy currently deployed content (i.e. bounce it with no content change):

touch $AS/standalone/deployments/example.war

https://docs.jboss.org/author/display/AS71/Application+deployment?_sscc=t

阅读更多内容