Bookmark this page

Guided Exercise: Creating a Standalone Server

Create a standalone JBoss EAP server.

Resources
Files: /home/student/AD248/labs/standalone-running
Application URL: http://localhost:18080 http://localhost:19990

Outcomes

You should be able to run a standalone JBoss EAP server using a custom location for the server base directory.

Before beginning the guided exercise, run the following command to verify that JBoss EAP is installed at /opt/jboss-eap-7.4 and to download the files for the exercise:

[student@workstation ~]$ lab start standalone-running

Instructions

  1. Copy the standalone directories to a new location.

    In this guided exercise, you create an alternative directory to customize the JBoss EAP server without changing the original installation. Copy the configuration, deployments, and lib directories to the new location.

    [student@workstation ~]$ cd /opt/jboss-eap-7.4/standalone
    [student@workstation standalone]$ cp -r configuration deployments lib \
    ~/AD248/labs/standalone-running
  2. Modify the standalone server port offset.

    To verify that the JBoss EAP server is utilizing the new, copied configuration files, update the port offset. You can run multiple instances of EAP, by using the port offset to avoid port conflicts.

    1. Update the new configuration file by editing the standalone.xml file to verify that JBoss EAP is using the configuration files in the new directory. Open the /home/student/AD248/labs/standalone-running/configuration/standalone.xml file with a text editor.

    2. In the standard-sockets socket binding group, change the default value of the port-offset attribute from 0 to 10000. This adds 10,000 to every port number used in the standard-sockets binding group.

      ...
      <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:10000}">
      ...
    3. Save your changes to the standalone.xml file, and close the text editor.

  3. Run and test the JBoss EAP Server

    1. Run the following command to start the JBoss EAP server by using the standalone.sh script in the original JBoss EAP installation, but using the new configuration files:

      [student@workstation standalone]$ cd /opt/jboss-eap-7.4/bin
      [student@workstation bin]$ ./standalone.sh \
      -Djboss.server.base.dir=/home/student/AD248/labs/standalone-running/

      The server starts up successfully with an output similar to the following:

      07:18:11,922 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: JBoss EAP 7.4.11.GA (WildFly Core 15.0.26.Final-redhat-00001) started in 4393ms - Started 318 of 557 services (343 services are lazy, passive or on-demand)
      07:18:11,925 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:19990/management
      07:18:11,925 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:19990
    2. On the workstation machine, navigate to http://localhost:18080 to see the JBoss EAP welcome page with the new port offset.

    3. On the workstation, navigate to http://localhost:19990 to see the JBoss EAP management console, which runs with the same port offset.

      Note

      The admin username is admin and the password is redhat123.

    4. Explore the contents of the directory /home/student/AD248/labs/standalone-running in a new terminal window:

      [student@workstation ~]$ ls /home/student/AD248/labs/standalone-running/
      configuration  data   deployments  lib  log  tmp

      Notice the three data, log, and tmp new directories . These directories are automatically created when the JBoss EAP server starts.

  4. Clean Up

    1. Stop the running instance of JBoss EAP that was started in the previous step. Press Ctrl+C in the terminal window in which the server is running.

Finish

On the workstation machine, use the lab command to complete this exercise. This step is important to ensure that resources from previous exercises do not impact upcoming exercises.

[student@workstation ~]$ lab finish standalone-running

Revision: ad248-7.4-18a9db2