WildFly – A New Improved JBoss Application Server for Linux

[‘

n

As we all know that JBoss AS has been renamed to WildFly. A lots of new features has been added and lots of has been upgraded. Finally WildFly 8.0.0 Final has been released on Feb 11.2014. WildFly Project Lead Jason Greene announced the same.

n

Install WildFly in Linux
WildFly 8 JBoss Application Server

n

WildFly 8 is Red Hat‘s Java EE 7 compliant open source application server. The Main features are as below:

n

Java EE 7 Compatibility

n

The biggest change in this is that now WildFly 8 is official Java EE7 Certified.

n

High Performance Web Server

n

Undertow is new high performance web server written in Java. Now this has been implemented in WildFly 8. This is really designed for high throughput and scalability and can handle millions of connections. Undertow’s lifecycle is completely controlled by the embedding application. This is extremely lightweight with core jar having size of 1MB and embedded server using less than 4MB of heap space. This is really great.

n

3Port Reduction

n

Since it is using Undertow which support for Upgrading HTTP, which will allow multiple protocols to be multiplexed over single HTTP port. WildFly 8 has moved nearly all of its protocols to be multiplexed over two HTTP ports: one is management and another one is application port. This is really a big change and benefit to cloud providers (such as OpenShift) who run hundreds to thousands of instances on a single server. In total, it has two default ports for configuration and they are 9990 (Web Administration Console) and 8080 (Application Console).

n

Management Role Based Access Control & Auditing

n

This is the new and interesting thing implemented in WildFly 8. By using this we can create different users and can assign those one to different roles as per requirements. I’ll show you later with screen shots.

n

Logging

n

The management API now supports the ability to list and view the available log files on a server. Now, we have attribute called “add-logging-api-dependencies” available for any kind of deployments in which we want to skip container logging. This will disable the adding of the implicit server logging dependencies. We have another option i.e. we can use a jboss-deployment-structure.xml to exclude the logging subsystem. Using this, it will help to stop the logging subsystem from going through any deployment.

n

We can also make use of another parameter i.e. use-deployment-logging-config for enabling/disabling processing of logging configuration files within a deployment.

n

Note: System Property that we were using for disabling per logging has been deprecated from this version.

n

Clustering

n

Again Big change is one clustering. All Features related to Clustering support had been changed in WildFly 8 and these includes as below:

n

    n

  1. Distributed web session has been optimized for it with new Java Based Web Server i.e. Undertow.
  2. n

  3. mod_cluster support for Undertow.
  4. n

  5. Optimized Distributed SSO(Single Sign-On) capabilities and support for Undertow.
  6. n

  7. New/optimized distributed @Stateful EJB caching implementation.
  8. n

  9. WildFly 8 added some new public clustering API.
  10. n

  11. For creating singleton services it provides new public APIs.
  12. n

n

CLI Improvements

n

CLI Configuration has also been improved. You know All admin love to work on CLI ;). So, now we can create alias for particular server and then can use that alias whenever want to connect to that server using connect command.

n

There are still lots of enhancements and updates done in WildFly 8. You can check all these at:

n

    n

  1. http://wildfly.org/news/2014/02/11/WildFly8-Final-Released/
  2. n

n

Installation of WildFly 8 in Linux

n

Before moving ahead with Installation make sure that you have Java EE 7 installed on your system. WildFly 8 will not work with previous revisions. Please follow the below guide to install Java EE 7 in the Linux systems.

n

    n

  1. Install JDK/JRE 7u25 in Linux
  2. n

n

Step 1: Downloading WildFly 8

n

Use the following link to download the latest WildFly zip file.

n

    n

  1. http://download.jboss.org/wildfly/8.0.0.Final/wildfly-8.0.0.Final.zip
  2. n

n

You may also use ‘wget‘ command to download directly on the command line.

n

[[emailxa0protected]]# wget http://download.jboss.org/wildfly/8.0.0.Final/wildfly-8.0.0.Final.zip

n

Copy zip file to any preferred location (e.g. ‘/data/‘ in my case) and extract using ‘unzip’ command.

n

[[emailxa0protected]]# cp wildfly-8.0.0.Final.zip /data/rn[[emailxa0protected]]# cd /data/rn[[emailxa0protected] data]# unzip wildfly-8.0.0.Final.zip

n

Step 2: Setting Environment Variables

n

Now set some environment variables. You can set these on system wise or within your configuration files. Here I am setting within configuration files standalone.sh and standalone.conf in ‘bin‘ folder.

n

[[emailxa0protected] data]# cd wildfly-8.0.0.Finalrn[[emailxa0protected] data]# cd bin/

n

Add these two following lines to standlone.sh/standlone.conf files. Please specify your WildFly installation location and Java Home location.

n

JBOSS_HOME=”/data/wildfly-8.0.0.Final”rnJAVA_HOME=”/data/java/jre7/bin/java”

n

Note: For whole system wide, you can set it under ‘/etc/profile‘ file.

n

Step 3: Starting WildFly 8

n

Now start server i.e. for standalone mode use ‘standalone.sh‘ and for domain mode use ‘domain.sh‘.

n

[[emailxa0protected] bin]# ./standalone.sh

n

[[emailxa0protected] bin]# ./domain.sh

n

But, here I am starting in standalone mode. By default it will get start by ‘standalone.xml‘ file, But You can also start with some other configuration using ‘–server-config‘ option.

n

As below I am starting server with ‘standalone-full-ha.xml‘ and this file is present in “$JBOSS_HOME/standalone(profile)/configuration/”.

n

[[emailxa0protected] bin]# ./standalone.sh --server-config standalone-full-ha.xml

n

Sample Output

n

Calling "/data/wildfly-8.0.0.Final/standalone/configuration/standalone.conf"rnSetting JAVA property to "/data/java/jre7/bin/java"rn===============================================================================rnrn  JBoss Bootstrap Environmentrnrn  JBOSS_HOME: "/data/wildfly-8.0.0.Final"rnrn  JAVA: "/data/java/jre7/bin/java"rnrn  JAVA_OPTS: "-client -Dprogram.name=standalone.sh -Xms64M -Xmx512M -XX:MaxPermrnSize=256M -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman"rnrn===============================================================================rnrn13:55:26,403 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.0.Finalrn13:55:33,812 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.0.Finalrn13:55:35,481 INFO  [org.jboss.as] (MSC service thread 1-1) JBAS015899: WildFly 8.0.0.Final "WildFly" startingrn13:55:58,646 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)rn...........rn13:56:22,778 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/managementrn13:56:22,794 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990rn13:56:22,794 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.0.0.Final "WildFly" started in 64534ms - Started 229 of 356 services (172 services are lazy, passive or on-demand)

n

Step 4: Acessing WildFly 8

n

Now you can point your browser to ‘http://localhost:8080‘ (if using the default configured http port) which brings you to the Welcome Screen.

n

Wildfly Welcome Screen
Wildfly Welcome Screen

n

From here, you can access WildFly community documentation guides and enhanced web-based Administration Console access.

n

Step 5: Managing WildFly 8

n

WildFly 8 provides two administrative consoles for managing running instance:

n

    n

      n

    1. web-based Administration Console
    2. n

    3. command-line interface
    4. n

    n

n

Before connecting to administration console or remotely using the command line, you will need to create a new user using the ‘add-user.sh‘ script in the bin folder.

n

Next, go to ‘bin‘ directory, set ‘JBOSS_HOME‘ in add-user.sh (if variable is not set on system bases) and create user as below.

n

[[emailxa0protected] bin]# ./add-user.sh

n

Once starting the script you will be guided through the process to add a new user:

n

Sample Output

n

What type of user do you wish to add?rn a) Management User (mgmt-users.properties)rn b) Application User (application-users.properties)rn(a):rnEnter the details of the new user to add.rnUsing realm 'ManagementRealm' as discovered from the existing property files.rnUsername : adminrnThe username 'admin' is easy to guessrnAre you sure you want to add user 'admin' yes/no? yesrnPassword recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.rn - The password should not be one of the following restricted values {root, admin, administrator}rn - The password should contain at least 8 characters, 1 alphanumeric character(s), 1 digit(s), 1 non-alphanumeric symbol(s)rn - The password should be different from the usernamernPassword :rnRe-enter Password :rnWhat groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[  ]:rnAbout to add user 'admin' for realm 'ManagementRealm'rnIs this correct yes/no? yesrnAdded user 'admin' to file '/data/wildfly-8.0.0.Final/standalone/configuration/mgmt-users.properties'rnAdded user 'admin' to file /data/wildfly-8.0.0.Final/domain/configuration/mgmt-users.properties'rnAdded user 'admin' with groups  to file /data/wildfly-8.0.0.Final/standalone/configuration/mgmt-groups.properties'rnAdded user 'admin' with groups  to file /data/wildfly-8.0.0.Final/domain/configuration/mgmt-groups.properties'rnIs this new user going to be used for one AS process to connect to another AS process?rne.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.rnyes/no? yesrnTo represent the user add the following to the server-identities definition rnPress any key to continue . . .

n

Now access the web-based Administration Console at ‘http://localhost:9990/console‘ and enter the new created username and password to directly access the Management Console.

n

WildFly Login
WildFly Login

n

First Screen After login.

n

WildFly Web Panel
WildFly Web Panel

n

If you prefer to handle your server from the CLI, run the ‘jboss-cli.sh‘ script from the ‘bin‘ directory that offers the same capabilities available via the web-based UI.

n

[[emailxa0protected] bin]# cd binrn[[emailxa0protected] bin]# ./jboss-cli.sh --connectrnConnected to standalone controller at localhost:9999

n

For more information, follow the official WildFly 8 documentation at https://docs.jboss.org/author/display/WFLY8/Documentation.

n

Read Also : WildFly (JBoss AS) – How to Access and Manage CLI Using GUI

n

‘]