Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon

WildFly – the Basics

Save for later
  • 6 min read
  • 21 Jul 2015

In this article, Luigi Fugaro, author of the book Wildfly Cookbook says that the JBoss.org community is a huge community, where people all over the world develop, test, and document pieces of code. There are a lot of projects in there, not just JBoss AS, which is now WildFly. I can mention a few: Infinispan, Undertow, PicketLink, Arquillian, HornetQ, RESTeasy, AeroGear, and Vert.X. For a complete list of all projects, visit http://www.jboss.org/projects/.

(For more resources related to this topic, see here.)

Despite marketing reasons, as there is no preferred project, the community wanted to change the name of the JBoss AS project to something different, which would not collide with the community name. There was also another reason, which was about the JBoss Red Hat supported version named JBoss Enterprise Application Platform (EAP). This was another point toward replacing the JBoss AS name.

Software prerequisites

WildFly runs on top of the Java platform. It needs at least Java Runtime Environment (JRE) version 1.7 to run (further reference to version 1.7 and 7 should be considered equal; the same applies to 1.8 and 8 as well), but it also works perfectly with latest JRE version 8.

As we will also need to compile and build Java web applications, we will need the Java Development Kit (JDK), which gives the necessary tools to work with the Java source code. In the JDK panorama, we can find the Oracle JDK, developed and maintained by Oracle, and OpenJDK, which relies on contributions by the community.

Nevertheless, since April 2015, Oracle no longer posts updates of Java SE 7 to its public download sites as mentioned at http://www.oracle.com/technetwork/java/javase/downloads/eol-135779.html. Also, bear in mind that Java Critical Patch Update is released on a quarterly basis; therefore, for reasons of stability and feature support, we will use the Oracle JDK 8, which is freely available for download at http://www.oracle.com/technetwork/java/javase/downloads/index.html.

While writing the book, the latest stable Oracle JDK is version 1.8.0_31 (8u31). From here on, every reference to Java Virtual Machine (JVM), Java, JRE, and JDK will be intended to be to Oracle JDK 1.8.0_31. To keep things simple, if you don't mind, use that same version.

In addition to the JDK, we will need Apache Maven 3, which is a build tool for Java projects. It is freely available for download at http://maven.apache.org/download.cgi. A generic download link can be found at http://www.us.apache.org/dist/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz.

Downloading and installing WildFly

In this article, you will learn how to get and install WildFly. As always in the open source world, you can do the same thing in different ways. WildFly can be installed using your preferred software manager or by downloading the bundle provided by the http://wildfly.org/ site. Going as per the JDK, we will choose the second way.

Getting ready

Just open your favorite browser and point it to http://wildfly.org/downloads/. You should see a page similar to this one:

wildflybasics-img-0

WildFly's download page

Now download the latest version into our WFC folder.

How to do it…

  1. Once the download is complete, open a terminal and extract its content into the WFC folder, executing the following commands:
    $ cd ~/WFC && tar zx wildfly-9.0.0.Beta2.tar.gz

    The preceding command will first point to our WildFly Cookbook folder; it will then extract the WildFly archive from it. Listing our WFC folder, we should find the newly created WildFly folder named wildfly-9.0.0.Beta2.

  2. To better remember and handle WildFly's installation directory, rename it to wildfly, as follows:
    $ cd ~/WFC && mv wildfly-9.0.0.Beta2 wildfly

    By the way, WildFly can be also installed using YUM, Fedora's traditional software manager.

    In production environment, you will not place the WildFly installation directory in the home folder of a specific user; rather, you will place it in different paths, relative to the context you are working on.

  3. Now, we need to create the JBOSS_HOME environment variable, which is used by WildFly itself as base directory when it starts up (in the feature release, this was updated to WILDFLY_HOME). We will also create the WILDFLY_HOME environment variable, which we will use through the whole book to reference WildFly's installation directory. Thus, open the .bash_profile file, placed in your home folder, with your favorite text editor, and add the following directives:
    export JBOSS_HOME=~/WFC/wildfly
    export WILDFLY_HOME=$JBOSS_HOME
  4. For the changes to take effect, you can either log out and log back in, or just issue the following command:
    $ source ~/.bash_profile

Your .bash_profile file should look as follows:

wildflybasics-img-1

Understanding the WildFly directory overview

Now that we have finished installing WildFly, let's look into its folders.

How to do it…

  1. Open your terminal and run the following command:
    $ cd $WILDFLY_HOME
    $ pwd && ls -la
  2. The output of your commands should be similar to the following image:

    wildflybasics-img-2

    WildFly's folders overview

How it works

The preceding image depicts WildFly's folder on the filesystem. Each is outlined in the following table:

Folder's name

Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at $19.99/month. Cancel anytime

Description

appclient

These are configuration files, deployment content, and writable areas used by the application client container run from this installation.

bin

These are the startup scripts; startup configuration files, and various command-line utilities, such as Vault, add-user, and Java diagnostic report available for the Unix and Windows environments.

bin/client

This contains a client JAR for use by non maven-based clients.

docs/schema

These are XML schema definition files.

docs/examples/configs

These are example configuration files representing specific use cases.

domain

These are configuration files, deployment content, and writable areas used by the domain mode processes run from this installation.

modules

WildFly is based on a modular class-loading architecture. The various modules used in the server are stored here.

standalone

These are configuration files, deployment content, and writable areas used by the single standalone server run from this installation.

welcome-content

This is the default Welcome Page content.

In the preceding table, I've emphasized the domain and standalone folders, which are those that determine in which mode WildFly will run: standalone or domain.

From here on, whenever mentioned, WildFly's home will be intended as $WILDFLY_HOME.

Summary

In this article, we covered the software prerequisites of WildFly, downloading and installing WildFly, and an overview of WildFly's folder structure.

Resources for Article:


Further resources on this subject: