Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Mastering JBoss Enterprise Application Platform 7
  • Table Of Contents Toc
  • Feedback & Rating feedback
Mastering JBoss Enterprise Application Platform 7

Mastering JBoss Enterprise Application Platform 7

By : Marchioni, Luigi Fugaro
3.7 (3)
close
close
Mastering JBoss Enterprise Application Platform 7

Mastering JBoss Enterprise Application Platform 7

3.7 (3)
By: Marchioni, Luigi Fugaro

Overview of this book

The JBoss Enterprise Application Platform (EAP) has been one of the most popular tools for Java developers to create modular, cloud-ready, and modern applications. It has achieved a reputation for architectural excellence and technical savvy, making it a solid and efficient environment for delivering your applications. The book will first introduce application server configuration and the management instruments that can be used to control the application server. Next, the focus will shift to enterprise solutions such as clustering, load balancing, and data caching; this will be the core of the book. We will also discuss services provided by the application server, such as database connectivity and logging. We focus on real-world example configurations and how to avoid common mistakes. Finally, we will implement the knowledge gained so far in terms of Docker containers and cloud availability using RedHat's OpenShift.
Table of Contents (15 chapters)
close
close

Basic server administration

Once the installation has been completed, it's about time to complete some basic administration tasks. The most obvious one involves creating one or more users for managing your platform. Out of the box, a script called add-user.sh is provided along with your installation. The purpose of this script is to manage two different types of user:

  • Management users: users in charge of administrating your application server
  • Application users: users in charge of accessing your applications

Note

Important notice!

The add-user script uses a very simple file-based mechanism to store the users' information. This can be acceptable for basic security requirements. Real-world scenarios, however, would need to use more appropriate security polices as detailed in Chapter 11, Securing the Application Server, of this book.

You can execute the add-user script both in an interactive way and in an automatic way.

In order to execute the add-user script in an interactive way, just execute it as follows and provide the requested information:

$ ./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 : administrator1
. . . . .
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 'administrator1' for realm 'ManagementRealm'
Is this correct yes/no? yes
To represent the user add the following to the server-
    identities definition <secret value="UGFzc3dvcmQxIQ==" />

We have removed some negligible information from the output so that you can focus on the required arguments of the script. The previous information can be filled in also in a non- interactive way by providing the username with the -u parameter, the password with the -p, and the group (if needed) with -g. You can discriminate between management users and application users with the -m and -a parameters.

Here is how to create a management user:

$ ./add-user.sh -m -u administrator1 -p Securepassword1!

Note

Once you have created the management user, you can verify that the login correctly lets you through the management console, which is available at http://localhost:9990.

On the other hand, here is the shell script to create an application user belonging to the guest group:

$ ./add-user.sh -a -u demouser -p Securepassword1! -g guest

Note

Beware that creating users in a non-interactive way exposes your user/password information across the shell history system process table if you are a Linux user.

Once you have created your users the following files (contained in the configuration folder of your server base directory) will be updated:

-rw-rw-r--. 1 francesco francesco   711 Oct 26 06:13 
    application-roles.properties
-rw-------. 1 francesco francesco   935 Oct 26 06:13 
    application-users.properties
-rw-rw-r--. 1 francesco francesco   646 Nov 24 16:11 mgmt-
    groups.properties
-rw-------. 1 francesco francesco  1111 Nov 24 16:11 mgmt-
    users.properties

The application-roles.properties holds the list of roles granted to application users. The file application-users.properties contains the list of application users and their hashed passwords. Conversely, mgmt-groups.properties contains the list of roles granted to management users and  mgmt-users.properties holds the management users and their hash passwords. As a final note, the password contained in *-users.properties files is in hash using this format:

username=HEX( MD5( username ':' realm ':' password)) 

Note

How to recover the password

Being an MD5 based hash means that the password is not reversible. On the other hand, consider that most hashes are also non-unique; rather, they're unique enough, so a collision is highly improbable, but still possible.

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY