2.4.2 Wildfly Application Server
Wildfly Requirements
Wildfly is a Java EE-based application server that can operate across platforms and is usable on any operating system that supports Java. The i2b2 releases from 1.7.12 require Wildfly 17 (earlier versions required version 10.0.0) to be installed on the i2b2 Server as it is used to manage all application operations between the i2b2 clients, the cells on the i2b2 server and the i2b2 database.
Required Version: Wildfly 17.0.1
Download from Website: JBOSS Downloads - Wildfly 17.0.1.final
Operating System |
Filename |
|
Linux or Windows |
wildfly-17.0.1.final.zip |
Important |
The version of Wildfly 17 that has been tested and verified to work with the i2b2 software from release 1.7.12 is available for download from the JBOSS Website. This has been setup as an automatic download and can only be accessed by clicking on the link shown above or the one listed in step 1. |
Wildfly 17 Installation Steps
- Download the zip file for Wildfly 17 by clicking on Begin Download.
- Locate the file (wildfly-17.0.1.final.zip) you just downloaded.
- Extract all the items in the zip file into a directory of your choice.
Linux Example: /opt/wildfly-17.0.1.final
Windows Example: C:\opt\wildfly-17.0.1.final
Tip |
You will want to make note of the location as it will be needed further along in the i2b2 installation. In the installation document whenever you see YOUR_JBOSS_HOME_DIR it will need to be replaced with the location of your Wildfly. For your convenience an installation Worksheet has been provided at the end of this document to track the setup locations. |
2.4.2.1 Recommended Ports
The i2b2 recommends you use the default port of 9090 for your http connection and 9009 for your AJP 1.3. If these ports are unavailable because another application is using them then you will need to edit the standalone.xml file to reconfigure them. This file is located in the following directory:
YOUR_JBOSS_HOME_DIR\standalone\configuration\standalone.xml
The two items to change in the standalone.xml file are:
- Change the non-SSL HTTP/1.1 Connector to a port that is available in your system. (example shown below)
<socket-binding name="http" port ="8080" /> |
- Change the AJP 1.3 Connector to another port that is available in your system. (example shown below)
<socket-binding name="ajp" port ="8008" /> |
Warning |
The i2b2 install scripts are using port 9090 for Wildfly. Therefore if you are changing the above ports in your standalone.xml file then you will need to make the same port changes to all the install scripts. |
2.4.2.2 Wildfly Logging Configuration
In Wildfly 17 the server logging configuration is defined in the standalone.xml file. By default JBoss has included two handlers; One for logging to the console and another for logging to a file. In order to maximize the speed of your server and to prevent running out of space our recommendation is to have the level of logging set to a low level such as INFO.
Steps to Edit Logging Level
- Go to the following directory:
YOUR_JBOSS_HOME_DIR\standalone\configuration\standalone.xml
- Open the standalone.xml file to edit its contents.
- Locate the <profile> section of the xml document.
- The handlers are in the urn:jboss:domain:logging:1.1 subsystem
- Verify the level name for the console-handler is INFO. Change it if necessary.
<periodic-rotating-file-handler name="FILE"> |
- Save the changes and close the file.
Note |
If you need to troubleshoot an issue you can set the level to DEBUG. Remember to return it to INFO when you are done. |
Troubleshooting Logging
If you are having trouble with this logging approach, try this alternative:
In YOUR_JBOSS_HOME_DIR\standalone\deployments\i2b2.war\WEB-INF\classes\log4j.properties
add:
log4j.logger.edu.harvard.i2b2=DEBUG |
2.4.2.3 Run Wildfly as a Linux Service
Setting up a Linux service to run your Wildfly Web Server will allow the server to continuously run in the background, without any user interaction. Another advantage of a Linux service is that it will run no matter which user is logged onto the machine. This means you do not have to leave a user logged onto the server just to keep Wildfly running. You can also configure the service to start automatically if the system is rebooted.
The information in this section will guide you through setting up Wildfly 17 to run as a Linux Service.
Overview of Steps
These are the basic steps that will be taken to set up the Linux Service.
Step 1: Change Working Directory
Step 2: Copy Wildfly Init Directory
Step 3: Create a New Directory
Step 4: Copy Configuration File to the New Directory
Step 5: Edit Configuration File
Step 6: Start Wildfly and Verification
Overview of Directories Involved in the Process
The following is an overview of the directories that will be used and referenced during the process of setting up JBoss to run as a service.
Directory |
Description |
|
/etc |
Standard Linux directory that contains the configuration files for the system. |
|
/etc/init.d |
Standard Linux directory that contains the startup scripts for various system services. |
|
/wildfly-17.0.1.final/bin/init.d |
Wildfly directory that was created when Wildfly was installed. |
The remaining sections will outline the steps to setup Wildfly to run as a Linux service.
Step 1: Change Working Directory
The first step is to log into the terminal and change your working directory to the init.d directory in your Wildfly directory. The init.d directory in your Wildfly directory contains the configuration file and script to start Wildfly.
Steps to Change Working Directory
- Open the terminal.
- Enter the following command to change your directory to the int.d directory in your Wildfly directory.
Change Directory Command
cd YOUR_WILDFLY_HOME_DIR/docs/contrib/scripts/init.d
Example: cd /opt/wildfly-17.0.1.final/docs/contrib/scripts/init.d
Step 2: Copy the Wildfly Init Directory
The second step in this process is to copy the Wildfly Control Script called wildfly-init-redhat.sh to the initialization directory on your Linux server. The wildfly-init-redhat.sh file contains the start and stop commands for the Wildfly Server and by copying it to your initialization directory the Wildfly server will be able to start automatically when the system is rebooted.
Steps to Copy jboss-as-standalone.sh File
Assumptions: you are still logged into the terminal and the working directory is /jboss-as-7.1.1.1.Final/bin/init.d
- Enter the following command to copy wildfly-init-redhat.sh file from the Wildfly directory.
Copy Command
cp wildfly-init-redhat.sh /etc/init.d/wildfly
- A copy of the file now resides in the standard /etc/init.d directory
Step 3: Create a New Directory
The third step in this process is to create a new directory in the standard etc directory. This new directory will contain the configuration file for when the JBoss service is started.
Create Directory Steps
- Enter the following command to create a new directory called wildfly.
Create Directory Command
mkdir /etc/default/wildfly
- A new directory called wildfly now resides in the /etc directory.
Step 4: Copy Configuration File to New Directory
The fourth step is to copy the configuration file called wildfly.conf to the directory you just created in the previous step. This file contains the general configuration for the init.d scripts.
Steps to Copy wildflyconf File
Assumptions: you are still logged into the terminal and the working directory is /wildfly-17.0.1.final/docs/contrib/scripts/init.d
- Enter the following command to copy wildfly.conf file from your Wildfly directory.
Copy Command
cp wildfly.conf /etc/defaults/widlfly
- A copy of the file now resides in the standard /etc/defaults/wildfly directory
Step 5: Edit Configuration File
The fifth step is to edit the JBOSS_USER in the jwildfly.conf file that you just copied to the wildfly directory in your etc directory. The JBoss user is the person who owns the process of stopping and starting the Wildfly server.
Steps to Update JBOSS_USER
- Enter the following command to open the wildfly.conf file in your /etc/defaults/wildfly directory.
Open Command
open /etc/defaults/wildfly.conf
Important |
If you are connected to the server remotely then you will need to alter the above command to open it with a text editor. Instead of open you would type vi or whatever editor command is appropriate for your environment. Example: vi /etc/defaults/wildfly.conf |
- Edit the JBOSS_USER to the name of the wildfly user who is the owner of the process.
- Save the changes and close the file.
Step 6: Start Wildfly and Verification
The sixth and final step is to start Wildfly and verify it is running correctly.
- Enter the following command to start your Wildfly server.
Change Directory Command
/etc/init.d/wildfly start
- The Wildfly server will run the commands to start.
- Once it has finished you can open a web browser and enter the following address:
- The Wildfly Welcome page will display if your Wildfly server started correctly.
2.4.2.4 Run Wildfly as a Windows Service
Setting up a Windows service to run your Wildfly Web Server will allow the server to continuously run in the background, without any user interaction. Another advantage of a Windows service is that it will run no matter which user is logged onto the machine. This means you do not have to leave a user logged onto the server just to keep Wildfly running. You can also configure the service to start automatically if the system is rebooted.
The information in this section will guide you through setting up Wildfly 17 to run as a Windows Service.
Overview of Steps
These are the basic steps that will be taken to set up the Windows Service.
Step 1: Copy Files to Wildfly Directory
Step 2: Update the Service Batch File Settings
Step 3: Install the Service
Step 4: Update the Windows Service Properties
Step 5: Verify Wildfly Service Started
Step 1: Copy Files to Wildfly Directory
Steps to Copy Files
- Go to YOUR_WILDFILY_HOME_DIR\docs/contrib/scripts.
Example: C:\opt\wildfly-17.0.1.final\docs/contrib/scripts
- Copy the service folder to C:\opt\wildfly-17.0.1.final\bin
Step 2: Update the Settings in the Service Batch File
One of the files you copied to your Wildfly directory was service.bat.
Steps to Modify service.bat
- Go to YOUR_WILDFILY_HOME_DIR\bin.
Example: C:\opt\wildfly-17.0.1.final\bin
- Locate the service.bat file and open it in Edit Mode.
Tip |
If you are installing multiple servers you may want to update these settings with something that is more meaningful. The DISLAYNAME will appear in your Windows Services list so if you are installing multiple servers on the same windows machine you may want to update these settings with something that is more meaningful. Example: If you have a development and production environment you may want to update the settings to one of the following. DISPLAYNAME=Wildfly Application Server 17.0.0.final Development The SHORTNAME needs to be unique |
- To prevent memory loss issues you need to modify the JAVA_OPTS setting to increase the memory.
Current Setting |
New Setting |
|
JAVAOPTS=-Xrs |
JAVAOPTS=-Xmx1024M -Xms512M -XX:MaxPermSize=512M -Xrs |
Step 3: Install the Service
The third step in this process is to install the service.
Installation Steps
- Open the Windows Command Prompt as an Administrator.
- Enter the following command to change your directory to the bin directory in your WILDFLY directory.
Change Directory Command
cd YOUR_WILDFLY_HOME_DIR\bin
Example: C:\opt\wildfly-17.0.1.final\bin
Note |
If you have set your JBOSS_HOME system variable you can replace the Wildfly directory path with %JBOSS_HOME%. Example: CD %JBOSS_HOME%\bin |
- Enter the following command to install the service.
Change Directory Command
service install
- Provided there are no errors the service will be installed.
Step 4: Update the Windows Service Properties
The fourth step is to update the properties of the service you just installed. During this step we will set the JBoss service to start automatically and we will start the service to make sure it was installed correctly.
Steps to Update Properties
- Go to your Administrative Tools directory
- Click on Start and select Control Panel.
- In the Control Panel click on System and Security.
- Click on Administrative Tools
- Double click on Services to display a list of local services installed on your server.
- Scroll to the service called Wildfly Application Server.
Important |
The actual name that appears in the list of services depends on what you entered in the service.bat file for the DISPLAYNAME setting. |
- Using the mouse, right click on the name of the service to display the pop-up menu.
- Select Properties to open the Properties Window.
- At Startup Type select Automatic from the drop-down list.
- Click on Start to start the Wildfly services.
- A dialog window will open displaying the progress of starting the service.
- Once the startup process is complete click on OK to save the changes.
Step 5: Verify Wildfly Server Started
The fifth and final step is to verify the Windows service started your Wildfly server.
Verification Steps
- Open a web browser and enter the following address:
http://localhost:9090/
- The Wildfly Welcome page will display if your Wildfly server started correctly.
Comments
0 comments
Please sign in to leave a comment.