Creating a New Configuration
You aren't limited to the three configurations
JBoss provides. In fact, instead of having unneeded services
loaded, wasting memory and CPU space, you can create your own JBoss
configuration that has exactly what you need. It's actually quite
easy to create a custom configuration.
How do I do that?
The
easiest
way to create your own configuration
is to copy an existing one and then rename the folder to something
that describes your configuration options. Once you've done that
you can add any new JARs and resources to that new server
configuration folder.
Let's say you want to create a new configuration
based on
minimal
that you can add other services to later.
You can copy the
minimal
server configuration folder to a
new folder in the
server
folder and call it
my_server_config
. On Unix this would be
cp -R minimal
my_server_config
.
You can run your new configuration like
this:
[bin]$
./run.sh -c my_server_config
The server will start up using your new
configuration, and you'll see console output that looks like
this:
=========================================================
JBoss Bootstrap Environment
JBOSS_HOME: /Users/samjr/jboss-4.0.2RC1
JAVA: java
JAVA_OPTS: -server -Xms128m -Xmx128m -Dprogram.name=run.sh
CLASSPATH: /Users/samjr/jboss-4.0.2RC1/bin/run.jar:/lib/tools.jar
=========================================================
05:49:22,213 INFO [Server] Starting JBoss (MX MicroKernel)...
05:49:22,217 INFO [Server] Release ID: JBoss [Zion] 4.0.2RC1 (build:
CVSTag=JBoss_4_0_2_RC1 date=200503140913)
05:49:22,220 INFO [Server] Home Dir: /Users/samjr/jboss-4.0.2RC1
05:49:22,221 INFO [Server] Home URL: file:/Users/samjr/jboss-4.0.2RC1/
05:49:22,223 INFO [Server] Library URL: file:/Users/samjr/jboss-4.0.2RC1/lib/
05:49:22,226 INFO [Server] Patch URL: null
05:49:22,244 INFO [Server]
Server Name: my_server_config
05:49:22,246 INFO [Server] Server Home Dir: /Users/samjr/jboss-4.0.
2RC1/server/my_server_config
05:49:22,247 INFO [Server] Server Home URL: file:/Users/samjr/jboss-4.0.
2RC1/server/my_server_config/
05:49:22,249 INFO [Server] Server Data Dir: /Users/samjr/jboss-4.0.2RC1/server/my_
server_config/data
05:49:22,250 INFO [Server] Server Temp Dir: /Users/samjr/jboss-4.0.2RC1/
server/my_server_config/tmp
05:49:22,251 INFO [Server] Server Config URL: file:/Users/samjr/jboss-4.0.
2RC1/server/my_server_config/conf/
05:49:22,285 INFO [Server] Server Library URL: file:/Users/samjr/jboss-4.0.
2RC1/server/my_server_config/lib/
05:49:22,287 INFO [Server] Root Deployment Filename: jboss-service.xml
05:49:22,294 INFO [Server] Starting General Purpose Architecture (GPA)...
[More startup information]
05:50:44,641 INFO [Server] JBoss (MX MicroKernel) [4.0.2RC1 (build:
CVSTag=JBoss_4_0_2_RC1 date=200503140913)] Started in 1m:21s:849ms
And with that, the new configuration is
started.
What about...
...adding or removing services from the
configuration?
While new configurations are nice simply as a
way to work in an isolated sandbox, the original
premise
for
creating a new configuration was to customize the set of services
available. We'll need a bit more background to do that type of
serious customization. But as we learn how to customize the
services throughout this book, you'll be able to come back and
apply those changes to your own configuration.
We hope you've seen how easy it is to get up and
running and how easy it is to create new configurations of the
JBoss server. The power is provided in a simple and configurable
way. Congratulations for getting this far. Now let's move on to the
next
chapter and see how to package and deploy a simple
application.
|