WildFly Configuration, Deployment, and Administration - Second Edition

Book description

Build a functional and efficient WildFly server with this step-by-step, practical guide

In Detail

WildFly 8 is a modular, lightweight, Java EE-compliant application server. Application deployment and management is simplified with WildFly's centralized and easy-to-use administration interface. It supports high availability and latest web technologies, such as web sockets and a non-blocking API. There was previously a lack of a system-administration-free platform that allowed the scaling of Java EE applications, but WildFly 8 in combination with OpenShift fills that gap.

The book starts with an explanation of the installation of WildFly and application server configuration. Then, it moves on to the configuration of enterprise services and also explores the new web container Undertow. It then covers domain configuration, application deployment, and application server management. By the end of the book, you will have a firm grasp of all the important aspects of clustering, load balancing, and WildFly security. This guide is invaluable for anyone who works with or is planning to switch to WildFly.

What You Will Learn

  • Discover how to install, start, and stop your WildFly server, and gain an understanding of the WildFly modular infrastructure
  • Configure WildFly's services such as transactions, threads, logging, Enterprise Java Beans, and Java Message Service
  • Set up the Undertow web server
  • Deploy applications on WildFly using various deployment strategies
  • Use JBoss' cloud platform OpenShift to simplify the deployment and management of applications
  • Manage the application server using the command-line interface and the admin console
  • Improve scalability by configuring high availability, clustering, and load balancing
  • Secure your WildFly server and enterprise application components using a number of authentication mechanisms

Table of contents

  1. WildFly Configuration, Deployment, and Administration Second Edition
    1. Table of Contents
    2. WildFly Configuration, Deployment, and Administration Second Edition
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Installing WildFly
      1. What's new in WildFly 8?
      2. Getting started with the application server
        1. Installing the Java environment
          1. Installing Java on Linux
          2. Installing Java on Windows
        2. Installing WildFly 8
        3. Starting WildFly
          1. Connecting to the server with the command-line interface
        4. Stopping WildFly
          1. Locating the shutdown script
          2. Stopping WildFly on a remote machine
        5. Restarting WildFly
        6. Installing the Eclipse environment
          1. Installing JBoss tools
      3. Exploring the application server filesystem
        1. The bin folder
        2. The docs folder
        3. The domain folder
        4. The standalone folder
        5. The welcome-content folder
        6. The modules folder
        7. Understanding WildFly's kernel
        8. Loading application server modules
      4. Summary
    9. 2. Configuring the Core WildFly Subsystems
      1. Configuring our application server
        1. Extensions
        2. Paths
        3. Management interfaces
        4. Profiles and subsystems
        5. Interfaces
        6. The socket-binding groups
        7. System properties
        8. Deployments
        9. Configuring core subsystems
        10. Configuring the thread pool subsystem
          1. Configuring the thread factory
          2. The bounded-queue thread pool
          3. The blocking bounded-queue thread pool
          4. The unbounded-queue thread pool
          5. The queueless thread pool
          6. The blocking queueless thread pool
          7. The scheduled thread pool
      2. Configuring application server logging
        1. Choosing your logging implementation
          1. Configuring the logging subsystem
        2. The console-handler
        3. The periodic-rotating-file-handler
        4. The size-rotating-file-handler
        5. The async-handler
        6. The syslog-handler
        7. Custom handlers
          1. Configuring loggers
          2. Per-deployment logging
          3. Bypassing container logging
      3. Summary
    10. 3. Configuring Enterprise Services
      1. Connecting to a database
        1. Installing the JDBC driver
        2. Adding a local datasource
          1. Configuring the connection pool
          2. Configuring the statement cache
          3. Adding an xa-datasource
        3. Installing the driver as a deployment unit
          1. Choosing the right driver deployment strategy
        4. Configuring a datasource programmatically
      2. Configuring the Enterprise JavaBeans container
        1. Configuring the EJB components
          1. Configuring the stateless session beans
            1. Using CLI to configure the stateless pool size
          2. Configuring the stateful session beans
          3. Configuring the message-driven beans
          4. Configuring the timer service
        2. Configuring the messaging system
          1. Configuring the transport
          2. Configuring connection factories
          3. Configuring JMS destinations
          4. Customizing destinations with an address
          5. HornetQ persistence configuration
        3. Configuring the transactions service
      3. Configuring concurrency
        1. Configuring the context service
        2. Configuring the managed thread factory
        3. Configuring the managed executor service
        4. Configuring the managed schedule executor service
      4. Summary
    11. 4. The Undertow Web Server
      1. An overview of Undertow
        1. The Undertow architecture
        2. Configuring Undertow
        3. Configuring the server
          1. Configuring the listener
          2. Configuring the host
          3. Serving static content
        4. Configuring the servlet container
          1. Configuring JSP
          2. Configuring the session cookie
          3. Saving the session state
        5. Configuring the buffer cache
      2. Creating and deploying a web application
      3. Creating a new Maven web project
        1. Adding JSF components
        2. Adding the EJB layer
        3. Choosing the web context of the application
        4. Deploying the web application
          1. Deploying a web application to the root context
        5. Adding a remote EJB client
          1. Configuring the client using a properties file
          2. Configuring the client programmatically
        6. Configuring data persistence
        7. Using a default datasource for the JPA subsystem
        8. Configuring entities
        9. Configuring persistence in other application archives
        10. Switching to a different provider
          1. Using Jipijapa
      4. Summary
    12. 5. Configuring a WildFly Domain
      1. Introducing the WildFly domain
      2. Understanding the default domain configuration
      3. Starting up and stopping a domain
      4. Configuring the domain
        1. Overriding the default configuration files
        2. Configuring the domain.xml file
        3. Configuring the host.xml file
        4. Configuring the management interfaces
        5. Configuring the network interfaces
        6. Configuring the domain controller
        7. Configuring the JVM
          1. Adding JVM options to a server definition
          2. Order of precedence between elements
          3. Configuring server nodes
        8. Applying domain configuration
      5. Creating our very own domain configuration
        1. Changing the domain configuration at runtime
      6. Summary
    13. 6. Application Structure and Deployment
      1. Deploying resources on the application server
        1. The JAR file
        2. The WAR file
        3. The EAR file
      2. Deploying applications on a standalone WildFly server
        1. Automatic application deployment
          1. Deploying applications to a custom folder
          2. Changing the behavior of the deployment scanner
          3. Deployment rollback
          4. Deploying an application using the CLI
          5. Deploying an application using the web admin console
          6. Deploying an application using the WildFly Eclipse plugin
            1. Configuring Eclipse deployments
        2. Manual application deployment
      3. Deploying applications on a WildFly domain
        1. Deploying to a domain using the CLI
          1. Deploying to all server groups
          2. Deploying to a single server group
        2. Deploying to a domain using the Admin console
      4. Explaining WildFly classloading
        1. Getting to know module names
        2. Finding the isolation level
          1. Implicit dependencies
          2. Explicit dependencies
        3. Setting up global modules
        4. Advanced deployment strategies
          1. Setting up a single module dependency
          2. Excluding the server's automatic dependencies
          3. Isolating sub-deployments
          4. Using the Class-Path declaration to solve dependencies
      5. Summary
    14. 7. Using the Management Interfaces
      1. The command-line interface (CLI)
        1. Reloading the server configuration
        2. Employing the CLI
          1. Navigating through the resources and executing operations
            1. Operations that can be issued on a resource
          2. Executing commands with the CLI
            1. Adding a JMS destination
            2. Creating and modifying datasources
              1. Creating and modifying XA datasources
            3. Getting help from the CLI
        3. Executing CLI scripts in batch
          1. Advanced batch commands
        4. Executing scripts in a file
          1. Redirecting non-interactive output
        5. Taking snapshots of the configuration
          1. What the application server saves for you
          2. Taking your own snapshots
        6. History of CLI
      2. The web admin console
        1. Accessing the admin console
        2. Configuring server profiles
          1. Configuring datasources
            1. Creating a new XA datasource
          2. Configuring JMS destinations
          3. Configuring socket-binding groups
      3. The CLI or web console?
      4. Summary
    15. 8. Clustering
      1. Setting up a WildFly cluster
        1. Setting up a cluster of standalone servers
          1. A cluster of nodes running on different machines
          2. A cluster of nodes running on the same machine
            1. Setting up a cluster on the same machine using multiple IP addresses
            2. Setting up a cluster on the same machine using port offset
        2. Setting up a cluster of domain servers
          1. Troubleshooting the cluster
      2. Configuring the WildFly cluster
        1. Configuring the JGroups subsystem
          1. Customizing the protocol stack
      3. Configuring the Infinispan subsystem
        1. Configuring session cache containers
        2. Choosing between replication and distribution
        3. Configuring the hibernate cache
          1. Using replication for the hibernate cache
        4. Advanced Infinispan configuration
          1. Configuring the Infinispan transport
          2. Configuring the Infinispan threads
      4. Clustering the messaging subsystem
        1. Configuring messaging credentials
      5. Configuring clustering in your applications
      6. Clustering session beans
      7. Clustering entities
      8. Caching entities
        1. Using JPA annotations
        2. Using Hibernate annotations
      9. Caching queries
      10. Clustering web applications
      11. Summary
    16. 9. Load-balancing Web Applications
      1. Benefits of using the Apache web server with WildFly
        1. Using the mod_jk library
          1. Installing Apache
          2. Installing mod_jk
        2. Configuring mod_proxy
      2. Load-balancing with mod_cluster
      3. Installing mod_cluster libraries
        1. The mod_cluster configuration
        2. Testing mod_cluster
      4. Managing mod_cluster via the CLI
      5. Managing your web contexts with the CLI
      6. Adding native management capabilities
      7. Managing web contexts using the configuration file
      8. Troubleshooting mod_cluster
      9. Load-balancing between nodes
        1. Using load metrics
        2. An example for setting dynamic metrics on a cluster
      10. Summary
    17. 10. Securing WildFly
      1. Approaching Java security API
        1. The WildFly security subsystem
        2. Using the UsersRoles login module
        3. Using the Database login module
          1. Encrypting passwords
        4. Using an LDAP login module
          1. Connecting LDAP to WildFly
        5. Securing web applications
        6. Securing EJBs
        7. Securing web services
      2. Securing the management interfaces
        1. Role-based access control
        2. Configuring groups
      3. Securing the transport layer
        1. Enabling the Secure Socket Layer
        2. Certificate management tools
        3. Securing HTTP communication with a self-signed certificate
        4. Securing the HTTP communication with a certificate signed by a CA
      4. Summary
    18. 11. WildFly, OpenShift, and Cloud Computing
      1. Introduction to cloud computing
        1. Cloud computing versus grid computing
        2. Advantages of cloud computing
        3. Cloud computing options
        4. Types of cloud services
      2. Getting started with OpenShift Online
        1. Installing OpenShift client tools
        2. Accessing your OpenShift account from a different computer
      3. Creating our first OpenShift application
        1. Installing your first cartridge
        2. Understanding the workflow
        3. Building the application
      4. Viewing the OpenShift server logfiles
        1. Tailing the logfile
        2. Viewing logs via SSH
      5. Managing applications in OpenShift
      6. Configuring your applications
        1. Adding a database cartridge
        2. Using OpenShift Tools and Eclipse
        3. Scaling your application
      7. Summary
    19. A. CLI References
      1. Startup options
      2. General commands
      3. The domain-mode commands
      4. Commands related to application deployment
      5. JMS
      6. Datasources
        1. Datasources (using operations on resources)
      7. Mod_cluster
      8. Batch
      9. Snapshots
    20. Index

Product information

  • Title: WildFly Configuration, Deployment, and Administration - Second Edition
  • Author(s): Christopher Ritchie
  • Release date: November 2014
  • Publisher(s): Packt Publishing
  • ISBN: 9781783286232