Book Image

WildFly Configuration, Deployment, and Administration

Book Image

WildFly Configuration, Deployment, and Administration

Overview of this book

Table of Contents (19 chapters)
WildFly Configuration, Deployment, and Administration Second Edition
About the Author
About the Reviewers


WildFly is the new name for the community version of JBoss AS. WildFly is still the most popular Java Enterprise server out there. It is easy to use, has a clean management interface, a powerful command-line tool, a modular architecture, is light, and is lightning quick. If you need product support, it is very easy to move from WildFly to JBoss EAP Server and, importantly, the license and support costs won't break the bank.

This book gently introduces you to WildFly by looking at how to download and install the server. We then move on to look at configuring enterprise services and the various subsystems, and securing your server and applications. The topics become more advanced as the book progresses, so in the later part of the book, we look at high availability, which is achieved through clustering and load balancing.

Whether you are a Java developer who wishes to improve their knowledge of WildFly, or you are a server administrator who wants to gain a better understanding of the inner workings of WildFly, there is something in this book for everyone.

What this book covers

Chapter 1, Installing WildFly, introduces you to the WildFly server. You are taken through the installation of Java and WildFly and learn to start, stop, and restart the server. You will also discover the purpose of the various folders within the WildFly install directory and gain a basic understanding of the WildFly kernel. Lastly, you will learn to install the WildFly server adaptor in Eclipse.

Chapter 2, Configuring the Core WildFly Subsystems, provides a detailed description of the anatomy of the standalone configuration file. You will be introduced to the concepts of modules and subsystems, and then you will learn in detail how to configure two of the core subsystems, the logging subsystem, and the thread-pool subsystem.

Chapter 3, Configuring Enterprise Services, teaches you to configure enterprise services and components, such as transactions, connection pools, Enterprise JavaBeans, and JMS. You will also learn to install JDBC drivers and configure database connections.

Chapter 4, The Undertow Web Server, explains the architecture of Undertow and teaches you how to configure the servlet container. You will also learn how to serve static content and configure JSPs. In this chapter, we create a simple web application using JSF, EJB, and JPA and teach you to deploy the application using the Eclipse WildFly Server adaptor.

Chapter 5, Configuring a WildFly Domain, teaches you how to manage a WildFly domain. It covers the domain and host controller configuration and outlines the differences between a server domain and multiple standalone server instances.

Chapter 6, Application Structure and Deployment, explains the structure of web and enterprise archives and how they are packaged. You will also learn in detail about the various ways to deploy your application to the WildFly server. We also explain how class loading works in WildFly.

Chapter 7, Using the Management Interfaces, introduces more advanced command-line interface commands, such as those for adding datasources and configuring JMS. We also provide a high-level overview of the web admin console.

Chapter 8, Clustering, provides detailed examples on clustering standalone and domain servers. You will also learn about JGroups and how to cluster the enterprise components, such as Messaging and Hibernate.

Chapter 9, Load-balancing Web Applications, explains the benefits of using the Apache web server with WildFly. You will also learn how to load-balance your web applications with mod_jk, mod_proxy, and mod_cluster.

Chapter 10, Securing WildFly, teaches you how to configure the security subsystem. We cover various login modules, such as database login and LDAP. We also look at securing enterprise components, such as Enterprise JavaBeans and web services. We then look at securing the management interfaces.

Chapter 11, WildFly, OpenShift, and Cloud Computing, discusses the advancement of cloud computing and the benefits it offers to your company. We see how OpenShift can be used to ease software development and aid rapid deployment of your applications to cloud servers.

Appendix, CLI References, provides a quick reference to some of the more commonly used commands in the CLI.

What you need for this book

Prior knowledge of Java is expected. Some knowledge of Enterprise Java would be beneficial, although not essential. To run WildFly, you will need the following software:

  • JDK 8

  • WildFly 8

  • MySQL (if you configure a MySQL datasource)

If you wish to run the Java code examples in this book, you will also need:

  • Maven 3

  • An IDE (Eclipse is used in the book)

  • MySQL

Who this book is for

This book is aimed at Java developers, system administrators, and anyone who wants to learn more about how to configure the WildFly 8 server. It will suit people who are new to WildFly server, as no prior experience is assumed. The book progresses to advanced concepts, which means it will also suit the more experienced system administrators and developers.


In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The content of this file will include the custom Web context, as specified by the context-root element."

A block of code is set as follows:

    <server name="server-one" group="other-server-group">
        <socket-bindings socket-binding-group="ha-sockets"/>

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

public class RemoteEJBClient { 
    static { 
        Security.addProvider(new JBossSaslProvider());
    public static void main(String[] args) throws Exception { 

Any command-line input or output is written as follows:

[standalone@localhost:9990 /] data-source remove --name=MySQLPool

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Agree to the terms and click on OK."


Warnings or important notes appear in a box like this.


Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at If you purchased this book elsewhere, you can visit and register to have the files e-mailed directly to you.


Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from


Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.


You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.