The Purpose of this WildFly Server Tutorial

This post covers a high-level quick and easy setup and installation of the WildFly server.

Note: These instructions use Windows syntax for directories but the steps are the same for Linux.

Installation of WildFly

Download the desired WildFly version, such as 8.2.1.

Extract the WildFly zip or tgz to a convenient location, such as C:\apps.

The remaining instructions assume WildFly version 8.2.1.

Add Users to Your WildFly Server

WildFly has convenient command line utilities, including one for adding users, in the C:\apps\wildfly-8.2.1.Final\bin directory.

This example adds a user named jeff with a password jeffpw and roles admin and developer (note: specify multiple roles by separating them by commas and no spaces, as in the example):

add-user -a -u jeff -p jeffpw -ro admin,developer

Check the user and role needs for the web apps you plan to have WildFly run and add them accordingly.

Startup Process

Run WildFly with its “standalone” script: C:\apps\wildfly-8.2.1.Final\bin\standalone.bat

By default, WildFly and any web apps it runs is at http://localhost:8080/

The Best Way to Shutdown WildFly Server

It’s best to shutdown WildFly server cleanly, and easiest to do so using its command line utility.

  1. Run: C:\apps\wildfly-8.2.1.Final\bin\jboss-cli.bat
  2. Type connect
  3. Type shutdown
  4. Exit this window
  5. Wait for WildFly console message that it is shutdown – see “Press any key to continue…”
  6. Close WildFly window by pressing a key

Install Web Applications

Copy web applications (.war and .ear files) to the C:\apps\wildfly-8.2.1.Final\standalone\deployments\ directory.

WildFly will detect them and automatically deploy the apps.

Configuration of WildFly

The main places to configure WildFly and its web apps are in its bin and configuration directories.

  • The C:\apps\wildfly-8.2.1.Final\bin\ directory has a Windows conf file: standalone.conf.bat and a non-Windows conf file: standalone.conf
  • The C:\apps\wildfly-8.2.1.Final\standalone\configuration\ directory has properties and xml configuration files.

I suggest configuring WildFly server using the conf files in the bin directory rather than the xml files so the settings apply to whichever xml file is in use.

By default, WildFly application server uses the standalone.xml file. Other options include standalone-full-ha.xml, and standalone-ha.xml.  Each one represents additional server options.

You can change the one used by setting the –server-config option via the SERVER_OPTS environment variable in the standalone.conf.bat file (or standalone.conf for non-Windows):

set SERVER_OPTS=--server-config=standalone-full.xml

Troubleshooting

WildFly server will also create text files in the deployments folder containing the status of each deployment; the file extension is the status and the contents any relevant info (e.g. failure messages and stack traces).  For example, a war named “kie-server-6.4.0.Final-ee7.war”, WildFly creates a “kie-server-6.4.0.Final-ee7.war.deployed” file when it is successfully deployed.

For additional troubleshooting information, refer to the log files in this directory: C:\apps\wildfly-8.2.1.Final\standalone\log\

 

Hopefully this is a good start for your setup. Let me know if you have any questions or suggestions for these notes.