How to run Java EE application on CentOS

梦想与她 提交于 2019-12-12 03:58:32

问题


I created an application with EJB and JSF.

I'd like to deploy my application to the web, so I got a dedicated server from hostgator. On this server I installed CentOS 6.7, Java 7 and JBoss AS 7.1.

I addition to that I have my own domain name.

How can I deploy my application to this server and how I can make this application reachable via my domain name?


回答1:


Here is information directly from 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.

You can also deploy manually:

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

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



来源:https://stackoverflow.com/questions/32414385/how-to-run-java-ee-application-on-centos

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!