Chapter 3. Starting and Stopping the Server

The simplest way to start and stop the server is to run the server instance using the run.sh or run.bat script and run the instance as a program in foreground. For information on other ways of running the server refer to the Administration and Configuration Guide.

3.1. Starting the Server

To start the JBoss Enterprise Application Server as a process in foreground, move to <JBOSS_HOME>/jboss-as/bin directory and execute the run.sh (on Red Hat Enterprise Linux) or run.bat (on Microsoft Windows) script. The server instance is run with the configuration set in the default profile as no other profile was specified.

Important

JBoss Enterprise Application Platform binds its services to localhost (127.0.0.1) by default, instead of binding to all available interfaces (0.0.0.0). This is to prevent remote access before a server is configured and secured correctly. To enable remote access by binding JBoss services to a particular interface, run JBoss with the -b option. To bind to all available interfaces and re-enable the legacy behavior use ./run.sh -b 0.0.0.0 on Linux . Make sure you secure your server properly.
Using -b as part of the server's command line is equivalent to setting these individual properties: -Djboss.bind.address, -Djava.rmi.server.hostname, -Djgroups.bind_addr and -Dbind.address. Passing -Djboss.bind.address to the Java process as part of the JAVA_OPTS variable in the run scripts will not work as it is a JBoss property not a JVM property.
For more information including setting up multiple server instances on one machine and hosting multiple domains with JBoss, please refer to the Administration and Configuration Guide.
On starting your server, your screen output should look like the following (accounting for the highlighted installation directory differences) and contain no error or exception messages:
[user@mypc bin]$ ./run.sh 
=========================================================================
  JBoss Bootstrap Environment
  JBOSS_HOME: <JBOSS_HOME>/jboss-as
  JAVA: java
  JAVA_OPTS: -Dprogram.name=run.sh -server -Xms1503m -Xmx1503m -Dsun.rmi.dgc.client.
gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true
  CLASSPATH: <JBOSS_HOME>/jboss-as/bin/run.jar
=========================================================================
More options for the JBoss Enterprise Application Platform run script are discussed in Section 3.1.1, “Starting the Server with Alternate Configuration” below.

Note

There is no Server Started message shown at the console when the server is started using the production profile. This message may be observed in the server.log file located in the server/production/log subdirectory.

3.1.1. Starting the Server with Alternate Configuration

Using run.sh without any arguments starts the server using the default server profile file set. To start with an alternate profile file set, pass the name of the server configuration file set (same as the name of the server configuration directory under <JBOSS_HOME>/jboss-as/server/<PROFILE>/) that you want to use, as the value to the -c command line option. For example, to start with the minimal profile file set you should specify:
[bin]$ ./run.sh -c minimal
  ...
  ...
  ...
  15:05:40,301 INFO  [Server] JBoss (MX MicroKernel) [5.0.0 (build: SVNTag=JBoss_5_0_0 date=200801092200)] Started in 5s:75ms