Let's get started with WildFly! WildFly is a Java middleware product also known as application server. The word "application server" has been coined in relation to Java Enterprise application; you can think of it as it’s a piece of Java software where your application can be provisioned using the services provided by the application server.

Installing WildFly

The pre-requisite to the Application Server installation is that you have available a JDK on your machine.

It is recommended to use a JDK 9 or higher to start WildFly. JDK can be either downloaded from Oracle site at http://www.oracle.com/technetwork/java/javase/downloads/index.html or you can use an open source implementation of it called OpenJDK http://openjdk.java.net/

Once installed the JDK, you have to set the JAVA_HOME environment variable accordingly.

Done with JDK installation, let’s move to the application server. WildFly can be downloaded from http://www.wildfly.org by following the Downloads link in the home page.

The current version of WildFly is: 18.0.0.GA

Once downloaded, extract the archive to a folder and you are done with the installation.

$ unzip wildfly-18.0.0.Final.zip

The application server ships with two server modes: standalone and domain mode. The difference between the two modes is not about the capabilities available but is related to the management of the application server: in particular, the domain mode is used when you run several instances of WildFly and you want a single point where you can manage servers and their configuration.

In order to start WildFly using the default configuration in "standalone" mode, change the directory to $JBOSS_HOME/bin and issue:

$ ./standalone.sh

To start the application server using the default configuration in "domain" mode, change directory to $JBOSS_HOME /bin and execute:

$ ./domain.sh

When starting in standalone mode, you should find in your console something like this, at the end of start up process:

1419:14:51,148 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: management interface listening on http://127.0.0.1:9990/management
19:14:51,148 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: listening on http://127.0.0.1:9990
19:14:51,149 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: 18.0.0.Final (WildFly Core 10.0.0.Final) started in 5615ms - Started 314
services (321 services are lazy, passive or on-demand)

You can verify that the server is reachable from the network by simply pointing your browser to the application server’s welcome page, which is reachable by default at the following address:

http://localhost:8080

getting started with wildfly getting started with wildfly

Your first task: Create a WildFly Administrator

If you want to manage the application server configuration using its management instruments, you need to create a management user.

In order to create a new user, just execute the add-user.sh/add-user.bat, which is located in the bin folder of the application server’s home.

  1. Select the default option "a" to add a Management user. This user is added to the ManagementRealm. Therefore it is authorized to perform management operations using the web-based Admin Console or the CLI (command-line interface). The other choice, b, adds a user to the ApplicationRealm, That realm is provided for use with applications.
  2. Enter the desired username and password.
  3. When prompted, enter the username and password. You will be prompted to confirm the password.
  4. Enter group information.
  5. Add the group or groups to which the user belongs. If the user belongs to multiple groups, enter a comma-separated list. Leave it blank if you do not want the user to belong to any groups.
  6. Review the information and confirm. If you are satisfied, type yes.

Here is a transcript which summarizes these steps:

$ ./add-user.sh 

What type of user do you wish to add? 
 a) Management User (mgmt-users.properties) 
 b) Application User (application-users.properties)
(a): a

Enter the details of the new user to add.
Using realm 'ManagementRealm' as discovered from the existing property files.
Username : admin123
Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
 - The password should be different from the username
 - The password should not be one of the following restricted values {root, admin, administrator}
 - The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
Password : 
Re-enter Password : 
What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[  ]: 
About to add user 'admin123' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'admin123' to file '/home/francesco/jboss/wildfly-18.0.0.Final/standalone/configuration/mgmt-users.properties'
Added user 'admin123' to file '/home/francesco/jboss/wildfly-18.0.0.Final/domain/configuration/mgmt-users.properties'
Added user 'admin123' with groups  to file '/home/francesco/jboss/wildfly-18.0.0.Final/standalone/configuration/mgmt-groups.properties'
Added user 'admin123' with groups  to file '/home/francesco/jboss/wildfly-18.0.0.Final/domain/configuration/mgmt-groups.properties'
Is this new user going to be used for one AS process to connect to another AS process? 
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
yes/no? yes
To represent the user add the following to the server-identities definition <secret value="UGFzc3dvcmQxMjM=" />

Now that we have got started with WildFly, let's continue learning: Getting to know WildFly folder structure

0
0
0
s2sdefault