I am working on setting up a JBoss app server on my dev platform (Ubuntu 10.04 server with JBoss 5.1) for my coldfusion apps and can't seem to find the resources I am looking for for setting up the virtual hosts. In the past I have used tomcat which I would setup a virtual host and use the c开发者_Go百科ontext tag to point to the root of the working directory. The directory was at /mnt/hgfs/ColdFusion/{project}/. Right at the root of the project directory was where my codebase and WEB-INF was.
I would like to setup the same thing on JBoss, but everything seems give different ways to setup the virtual host and none seem to talk about a comparison of the context tag in Tomcat.
So is there a way to do the context tag from tomcat and what is the best way to setup virtual hosts in JBoss AS 5.1?
You can setup virtual hosts just like in Tomcat (in fact JBoss Web Service is sightly modified version of Tomcat).
You can find proper in yours profile in the deploy/jbossweb.sar/server.xml
. You hvae just define in that file virtual hosts by defining Host
tag.
Next you have to setup your application. Just create jboss-web.xml
file and place it in application WEB-INF
direcotry. In that file you have to bind your application with proper virtual host. It can looks like that:
<jboss-web>
<context-root>/application_context</context-root>
<virtual-host>virtual_host</virtual-host>
</jboss-web>
You can find some more info in that article: Hosting Multiple Domains With JBoss
Install application from outside direcotry
You can add extra directory in which you can deploy your application (just like deploy
directory).
You have to edit conf/bootstrap/profile.xml
- you can find in your profile. Find property name applicationURIs
and add extra dir:
<property name="applicationURIs">
<list elementClass="java.net.URI">
<value>${jboss.server.home.url}deploy</value>
<!-- Below new directory do scan by JBoss AS -->
<value>file:///nfs/applications</value>
</list>
</property>
More info you can find here: How to deploy my application in an external directory in JBoss-5
精彩评论