Book Details

ISBN 139781784392413

Paperback604 pages

Book Description

With the increasing demand for distributed systems for Java applications, WildFly offers a robust platform on which to deploy and manage your services. As a matter of fact, WildFly 9 is a fully certified Java EE 7 platform and provides remote management tools, such as the redesigned Admin Console and the new and powerful Command Line Interface (CLI).

With practical and accessible material, you will begin by learning to set up your WildFly runtime environment, and progress to selecting appropriate operational models, managing subsystems, and conquering the CLI. You will then walk through the different balancing and clustering techniques, simultaneously learning about role-based access control and then developing applications targeting WildFly and Docker.

Table of Contents

Chapter 1: Welcome to WildFly!

Introduction

Software prerequisites

Downloading and installing WildFly

Understanding WildFly's directory overview

Running WildFly in standalone mode

Running WildFly in domain mode

Running WildFly as a service

Chapter 2: Running WildFly in Standalone Mode

Introduction

Running WildFly from a custom configuration folder

Binding WildFly onto a custom port

Binding WildFly onto a custom IP

Configuring multiple WildFly instances to run on the same machine with different ports

Configuring multiple WildFly instances to run on the same machine with different IPs

Managing applications using the deployments folder

Connecting to the CLI

Checking the server-state via the CLI

Deploying an application via the CLI

Undeploying an application via the CLI

Executing commands in batch mode via the CLI

Reloading a server configuration via the CLI

Shutting down and restarting an instance via the CLI

Suspending and resuming an instance via the CLI

Backing up your configuration file via the CLI

Chapter 3: Running WildFly in Domain Mode

Introduction

Running domain mode

Connecting the host controller to the domain controller

Stopping and starting server groups via the Web Console

Stopping and starting your server groups via the CLI

Stopping and starting your servers via the CLI

Deploying and undeploying an application to a specific server group via Web Console

Deploying and undeploying an application to a specific server group via the CLI

Checking server status via the CLI

Chapter 4: Managing the Logging Subsystem with the CLI

Introduction

Creating a file-handler logging

Creating a periodic-rotating file-handler

Creating a size-rotating file-handler

Defining asynchronous handlers

Creating a syslog-handler

Listing and reading log files

Using a different logging implementation

Chapter 5: Managing the Datasource Subsystems with the CLI

Introduction

Preparing a non JDBC-4 compliant driver

Creating and removing a datasource

Checking the datasource connection

Reading the datasource's statistics

Setting a connection pool

Creating and removing XA-Datasource

Chapter 6: Clustering WildFly

Introduction

Creating a cluster in standalone mode

Creating separate clusters in standalone mode

Creating a cluster in domain mode

Creating separate clusters in domain mode

Creating a cluster via TCP

Testing the UDP protocol with the JGroups tool

Chapter 7: Load Balancing WildFly

Introduction

Installing and configuring Apache HTTPD

Installing and configuring mod_cluster for Apache

Balancing WildFly using auto advertising – UDP

Balancing WildFly using a list of available balancers – TCP

Balancing using the HTTP connector instead of AJP

Preserve WildFly workers while restarting Apache

Balancing the same context for different applications

Rolling updates

Chapter 8: Commanding the CLI

Introduction

Invoking CLI commands

Checking the WildFly version

Checking WildFly operational mode

Getting the OS version

Getting the JVM version

Checking the JVM options

Checking JVM memories – heap-size and all

Checking the server status

Checking the JNDI tree view

Invoking CLI commands declared in an external file

Chapter 9: Conquering the CLI

Introduction

Invoking server stop, start, and reload

Invoking server group stop, start, restart, and reload

Creating a server group

Creating a server

Managing an application – deploy, undeploy

Chapter 10: Hardening the WildFly Communication

Introduction

Securing WildFly using HTTPS

Securing a specific application using HTTPS

Securing the WildFly console using HTTPS

Securing domain and host controller communication using HTTPS

Chapter 11: Hardening the WildFly Configuration

Introduction

Delivering your configuration using property files

Securing your configuration hashing passwords

Securing and protecting passwords using a vault

Chapter 12: Role-based Access Control with WildFly

Introduction

Switching between simple and RBAC providers

Managing users, groups, and their role mapping

Setting a predefined role to all authenticated users

Granting user access by server group or host – scoped roles

Integrating with OpenLDAP

Chapter 13: Messaging with WildFly

Introduction

Running the messaging system using HornetQ

Sending and receiving messages to/from a JMS queue destination

Clustering HornetQ using a shared store

Clustering HornetQ using message replication

Chapter 14: WildFly into the Cloud with OpenShift

Introduction

Registering to OpenShift Online

Installing the WildFly cartridge for our first deployment

Taking control of your WildFly server via SSH

Deploying your code to OpenShift Online

Chapter 15: Using WildFly with Docker

Introduction

Setting up the Docker environment

Running WildFly in Docker

Logging WildFly outside Docker

Running WildFly in domain mode in Docker using different Docker containers

Authors

Luigi Fugaro

Luigi Fugaro had his first encounter with computers back in the early 80s when he was still a kid. He started with a Commodore Vic-20, passing through a Sinclair, a Commodore 64, and an Atari ST 1040, where he spent days and nights giving breath mints to Otis. Then he took a big jump to a 486DX2 66MHz and started programming in Pascal and Basic.

In 1998, he started his career as a webmaster doing HTML, JavaScript, Applets, and some graphics with Paint Shop Pro. He then switched to Delphi, Visual Basic, and finally, started working on Java projects.

While working on Java, he met a lot of people who helped him get more and more hard and soft skills. Luigi has been developing in Java, all kinds of web applications, dealing with both backend and frontend frameworks, for various system integrators.

During his years in Red Hat, Luigi met extraordinary people, both for personal and professional reasons, who believed in him and helped him in his carrier.

He is still working with Red Hat, where he can count on a wide group of highly talented people who help him daily. He would like to mention all of them, but a few of them need special recognition: Ugo, Grande Marinelli, Nonno, Mr. Bernacchi, Frank, 3A, Vocal, eljeko, Scardy, Rinaldo (don’t mind the order).

He has authored WildFly Cookbook by Packt Publishing.

Table of Contents

Chapter 1: Welcome to WildFly!

Introduction

Software prerequisites

Downloading and installing WildFly

Understanding WildFly's directory overview

Running WildFly in standalone mode

Running WildFly in domain mode

Running WildFly as a service

Chapter 2: Running WildFly in Standalone Mode

Introduction

Running WildFly from a custom configuration folder

Binding WildFly onto a custom port

Binding WildFly onto a custom IP

Configuring multiple WildFly instances to run on the same machine with different ports

Configuring multiple WildFly instances to run on the same machine with different IPs

Managing applications using the deployments folder

Connecting to the CLI

Checking the server-state via the CLI

Deploying an application via the CLI

Undeploying an application via the CLI

Executing commands in batch mode via the CLI

Reloading a server configuration via the CLI

Shutting down and restarting an instance via the CLI

Suspending and resuming an instance via the CLI

Backing up your configuration file via the CLI

Chapter 3: Running WildFly in Domain Mode

Introduction

Running domain mode

Connecting the host controller to the domain controller

Stopping and starting server groups via the Web Console

Stopping and starting your server groups via the CLI

Stopping and starting your servers via the CLI

Deploying and undeploying an application to a specific server group via Web Console

Deploying and undeploying an application to a specific server group via the CLI

Checking server status via the CLI

Chapter 4: Managing the Logging Subsystem with the CLI

Introduction

Creating a file-handler logging

Creating a periodic-rotating file-handler

Creating a size-rotating file-handler

Defining asynchronous handlers

Creating a syslog-handler

Listing and reading log files

Using a different logging implementation

Chapter 5: Managing the Datasource Subsystems with the CLI

Introduction

Preparing a non JDBC-4 compliant driver

Creating and removing a datasource

Checking the datasource connection

Reading the datasource's statistics

Setting a connection pool

Creating and removing XA-Datasource

Chapter 6: Clustering WildFly

Introduction

Creating a cluster in standalone mode

Creating separate clusters in standalone mode

Creating a cluster in domain mode

Creating separate clusters in domain mode

Creating a cluster via TCP

Testing the UDP protocol with the JGroups tool

Chapter 7: Load Balancing WildFly

Introduction

Installing and configuring Apache HTTPD

Installing and configuring mod_cluster for Apache

Balancing WildFly using auto advertising – UDP

Balancing WildFly using a list of available balancers – TCP

Balancing using the HTTP connector instead of AJP

Preserve WildFly workers while restarting Apache

Balancing the same context for different applications

Rolling updates

Chapter 8: Commanding the CLI

Introduction

Invoking CLI commands

Checking the WildFly version

Checking WildFly operational mode

Getting the OS version

Getting the JVM version

Checking the JVM options

Checking JVM memories – heap-size and all

Checking the server status

Checking the JNDI tree view

Invoking CLI commands declared in an external file

Chapter 9: Conquering the CLI

Introduction

Invoking server stop, start, and reload

Invoking server group stop, start, restart, and reload

Creating a server group

Creating a server

Managing an application – deploy, undeploy

Chapter 10: Hardening the WildFly Communication

Introduction

Securing WildFly using HTTPS

Securing a specific application using HTTPS

Securing the WildFly console using HTTPS

Securing domain and host controller communication using HTTPS

Chapter 11: Hardening the WildFly Configuration

Introduction

Delivering your configuration using property files

Securing your configuration hashing passwords

Securing and protecting passwords using a vault

Chapter 12: Role-based Access Control with WildFly

Introduction

Switching between simple and RBAC providers

Managing users, groups, and their role mapping

Setting a predefined role to all authenticated users

Granting user access by server group or host – scoped roles

Integrating with OpenLDAP

Chapter 13: Messaging with WildFly

Introduction

Running the messaging system using HornetQ

Sending and receiving messages to/from a JMS queue destination

Clustering HornetQ using a shared store

Clustering HornetQ using message replication

Chapter 14: WildFly into the Cloud with OpenShift

Introduction

Registering to OpenShift Online

Installing the WildFly cartridge for our first deployment

Taking control of your WildFly server via SSH

Deploying your code to OpenShift Online

Chapter 15: Using WildFly with Docker

Introduction

Setting up the Docker environment

Running WildFly in Docker

Logging WildFly outside Docker

Running WildFly in domain mode in Docker using different Docker containers

Alerts & Offers

Series & Level

We understand your time is important. Uniquely amongst the major publishers, we seek to develop and publish the broadest range of learning and information products on each technology. Every Packt product delivers a specific learning pathway, broadly defined by the Series type. This structured approach enables you to select the pathway which best suits your knowledge level, learning style and task objectives.

Learning

As a new user, these step-by-step tutorial guides will give you all the practical skills necessary to become competent and efficient.

Beginner's Guide

Friendly, informal tutorials that provide a practical introduction using examples, activities, and challenges.

Essentials

Fast paced, concentrated introductions showing the quickest way to put the tool to work in the real world.

Cookbook

A collection of practical self-contained recipes that all users of the technology will find useful for building more powerful and reliable systems.

Blueprints

Guides you through the most common types of project you'll encounter, giving you end-to-end guidance on how to build your specific solution quickly and reliably.

Mastering

Take your skills to the next level with advanced tutorials that will give you confidence to master the tool's most powerful features.

Starting

Accessible to readers adopting the topic, these titles get you into the tool or technology so that you can become an effective user.

Progressing

Building on core skills you already have, these titles share solutions and expertise so you become a highly productive power user.