Virtual Hosting and JBoss Web
For the sake of this how-to, assume you have a development host with two
stimpy. Let's also assume
one instance of JBoss Web running, so
$CATALINA_HOME refers to
wherever it's installed, perhaps
Also, this how-to uses Unix-style path separators and commands; if you're on Windows modify accordingly.
At the simplest, edit the Engine portion
server.xml file to look like this:
<Engine name="Catalina" defaultHost="ren"> <Host name="ren" appBase="webapps/ren"/> <Host name="stimpy" appBase="webapps/stimpy"/> </Engine>
Create directories for each of the virtual hosts:
mkdir $CATALINA_HOME/webapps/ren mkdir $CATALINA_HOME/webapps/stimpy
Within your Context, create a
META-INFdirectory and then place your Context definition in it in a file named
$CATALINA_HOME/webapps/ren/ROOT/META-INF/context.xmlThis makes deployment easier, particularly if you're distributing a WAR file.
Create a structure under
$CATALINA_HOME/conf/Catalinacorresponding to your virtual hosts, e.g.:mkdir $CATALINA_HOME/conf/Catalina/ren mkdir $CATALINA_HOME/conf/Catalina/stimpy
Note that the ending directory name "Catalina" represents the
nameattribute of the Engine element as shown above.
Now, for your default webapps, add:$CATALINA_HOME/conf/Catalina/ren/ROOT.xml $CATALINA_HOME/conf/Catalina/stimpy/ROOT.xml
If you want to use the JBoss Web manager webapp for each host, you'll also need to add it here:cd $CATALINA_HOME/conf/Catalina cp localhost/manager.xml ren/ cp localhost/manager.xml stimpy/
Consult the configuration documentation for other attributes of the Context element.