Bitnami WildFly Installer

NOTE: Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and Mac OS X) or by clicking the shortcut in the Start Menu under "Start -> Bitnami APPNAME Stack -> Application console" (Windows). Learn more.
NOTE: When running the commands shown on this page, replace the installdir placeholder with the full installation directory for your Bitnami stack.

Description

Wildfly is a lightweight, open source application server, formerly known as JBoss, that implements the latest enterprise Java standards.

First steps with the Bitnami WildFly Stack

Welcome to your new Bitnami application! Here are a few questions (and answers!) you might need when first starting with your application.

What are the system requirements?

Before you download and install your application, check that your system meets these requirements.

How do I install the Bitnami WildFly Stack?

Windows, OS X and Linux installer
  • Download the executable file for the Bitnami WildFly Stack from the Bitnami website.

  • Run the downloaded file:

    • On Linux, give the installer executable permissions and run the installation file in the console.
    • On other platforms, double-click the installer and follow the instructions shown.

Check the FAQ instructions on how to download and install a Bitnami Stack for more details.

The application will be installed to the following default directories:

Operating System Directory
Windows C:\Bitnami\APPNAME-VERSION
Mac OS X /Applications/APPNAME-VERSION
Linux /opt/APPNAME-VERSION (running as root user)
OS X VM
  • Download the OS X VM file for the Bitnami WildFly Stack from the Bitnami website.
  • Begin the installation process by double-clicking the image file and dragging the WordPress OS X VM icon to the Applications folder.
  • Launch the VM by double-clicking the icon in the Applications folder.

What credentials do I need?

You need application credentials, consisting of a username and password. These credentials allow you to log in to your new Bitnami application.

What is the administrator username set for me to log in to the application for the first time?

  • For Windows, Linux and OS X installers, the username was configured by you when you first installed the application.
  • For OS X VMs, the username can be obtained by clicking the Bitnami badge at the bottom right corner of the application welcome page.

What is the administrator password?

  • For Windows, Linux and OS X installers, the password was configured by you when you first installed the application.
  • For OS X VMs, the password can be obtained by clicking the Bitnami badge at the bottom right corner of the application welcome page.

How to start or stop the services?

Linux

Bitnami native installers include a graphical tool to manage services. This tool is named manager-linux-x64.run on Linux and is located in the installation directory. To use this tool, double-click the file and then use the graphical interface to start, stop or restart services. Server log messages can be checked in the "Server Events" tab.

Management tool

The native installer also includes a command-line script to start, stop and restart applications, named ctlscript.sh. This script can be found in the installation directory and accepts the options start, stop, restart, and status. To use it, log in to the server console and execute it following the examples below:

  • Call it without any service names to start all services:

      $ sudo installdir/ctlscript.sh start
    
  • Use it to restart a specific service only by passing the service name as argument - for example, mysql, postgresql or apache:

      $ sudo installdir/ctlscript.sh restart mysql
      $ sudo installdir/ctlscript.sh restart postgresql
      $ sudo installdir/ctlscript.sh restart apache
    
  • Obtain current status of all services:

      $ installdir/ctlscript.sh status
    

The list of available services varies depending on the required components for each application.

Mac OS X

Bitnami native installers include a graphical tool to manage services. This tool is named manager-osx on Mac OS X and is located in the installation directory. To use this tool, double-click the file and then use the graphical interface to start, stop or restart services. Server log messages can be checked in the "Server Events" tab.

Management tool

The native installer also includes a command-line script to start, stop and restart applications, named ctlscript.sh. This script can be found in the installation directory and accepts the options start, stop, restart, and status. To use it, log in to the server console and execute it following the examples below:

  • Call it without any service names to start all services:

    $ sudo installdir/ctlscript.sh start
    
  • Use it to restart a specific service only by passing the service name as argument - for example, mysql or apache:

     $ sudo installdir/ctlscript.sh restart mysql
     $ sudo installdir/ctlscript.sh restart apache
    
  • Obtain current status of all services:

     $ installdir/ctlscript.sh status
    

The list of available services varies depending on the required components for each application.

NOTE: If you are using the stack manager for Mac OS X-VM, please check the following blog post to learn how to manage services from its graphical tool.

Windows

Bitnami native installers include a graphical tool to manage services. This tool is named manager-windows.exe on Windows and is located in the installation directory. To use this tool, double-click the file and then use the graphical interface to start, stop or restart services. Server log messages can be checked in the "Server Events" tab.

Management tool

The Windows native installer creates shortcuts to start and stop services created in the Start Menu, under "Programs -> Bitnami APPNAME Stack -> Bitnami Service". Servers can also be managed from the Windows "Services" control panel. Services are named using the format APPNAMESERVICENAME, where APPNAME is a placeholder for the application name and SERVICENAME is a placeholder for the service name. For example, the native installer for the Bitnami WordPress Stack installs services named wordpressApache and wordpressMySQL.

These services will be automatically started during boot. To modify this behaviour, refer to the section on disabling services on Windows.

How can I get started with WildFly?

To get started, we suggest the following steps:

Step 1. Access the management console.

The Wildfly management console provides an interface to manage the Wildfly server and deploy applications. To access it, refer to these instructions.

Step 2. Use Apache with Wildfly.

You can connect the Apache Web server with Wildfly through an HTTP proxy. To make them work together, enable the mod_proxy.so and mod_proxy_http.so modules in installdir/apache2/conf/httpd.conf and then configure the ProxyPass directive in the installdir/wildfly/conf/wildfly.conf file.

For more information, refer to these instructions.

How to access the WildFly server console?

Access the WildFly console by browsing to http://localhost:9990/console.

How to find the MySQL database credentials?

What are the default access credentials for the server console?

The default user name is manager and the password is the one set during installation.

How to connect to the MySQL database?

You can connect to the MySQL database from the same computer where it is installed with the mysql client tool.

$ mysql -u root -p

You will be prompted to enter the root user password. This is the same as the application password.

How is Apache server connected with WildFly?

Bitnami stacks include the Apache Web server. There are different ways to connect these two servers. One of this is connecting through an HTTP proxy.

The HTTP Connector element represents a Connector component that communicates with a web connector via the HTTP protocol. This is used to invisibly integrate Wildfly into an Apache installation and have Apache handle the static content of the web application and/or to utilize Apache's SSL processing.

To make them work together, enable the mod_proxy.so and mod_proxy_http.so modules in installdir/apache2/conf/httpd.conf. Then, add the following lines to the installdir/wildfly/conf/wildfly.conf file:

<Location /APPURL>
  ProxyPass http://localhost:8090/APPURL
</Location>

How to access the management console from another machine?

In case you wish to access the management console from another machine, follow these steps:

  • Modify the Wildfly standalone configuration file at installdir/wildfly/standalone/configuration/standalone.xml as shown below.

     <interface name="management">
         <inet-address value="${jboss.bind.address.management:0.0.0.0}"/>
     </interface>
    
  • Edit the installdir/wildfly/conf/wildfly.conf file and add the following line in the ** directive:

     <Location />
         ProxyPreserveHost On
         ProxyPass http://localhost:8080/
     </Location>
    
  • Open the management console port (9990) in the firewall.

  • Restart your servers for the changes to take effect.

     $ cd installdir
     $ sudo ./ctlscript.sh restart
    

You should now be able to access the Wildfly console from another host.

How to connect to WildFly from a different machine?

For security reasons, the WildFly ports in this solution cannot be accessed over a public IP address. To connect to WildFly from a different machine, you must open port 80, 443 for remote access. Refer to the FAQ for more information on this.

IMPORTANT: Bitnami Native Installers do not modify the firewall configuration of your computer, therefore the WildFly ports could be open which is a significant security risk. You are strongly advised to close the WildFly ports (refer to the FAQ for more information on this).

How to reset the MariaDB root password?

Please note that depending on the version you have installed, you may find the MariaDB files at installdir/mysql

If you don't remember your MariaDB root password, you can follow the steps below to reset it to a new value:

  • Create a file in /home/bitnami/mysql-init with the content shown below (replace NEW_PASSWORD with the password you wish to use):

     UPDATE mysql.user SET Password=PASSWORD('NEW_PASSWORD') WHERE User='root';
     FLUSH PRIVILEGES;
    
  • Stop the MariaDB server:

     $ sudo installdir/ctlscript.sh stop mariadb
    
  • Start MariaDB with the following command:

     $ sudo installdir/mariadb/bin/mysqld_safe --defaults-file=installdir/mariadb/my.cnf --pid-file=installdir/mariadb/data/mysqld.pid --init-file=/home/bitnami/mysql-init 2> /dev/null &
    
  • Restart the MariaDB server:

     $ sudo installdir/ctlscript.sh restart mariadb
    
  • Remove the init script

     $ rm /home/bitnami/mysql-init
    

How to change the MariaDB root password?

You can modify the MariaDB password using the following command at the shell prompt:

$ installdir/mariadb/bin/mysqladmin -p -u root password NEW_PASSWORD

How to create an SSL certificate for Wildfly?

The commands required to create a self-signed certificate for Wildfly are shown below:

$ cd installdir/wildfly/standalone/configuration
$ sudo keytool -genkey -alias server -keyalg RSA -validity 3650 -keysize 2048 -keystore server.keystore
$ sudo chown wildfly:wildfly ./server.keystore

How to enable SSL in Wildfly?

If your application includes lines similar to this in its web.xml file, you are forcing secure connections to Wildfly:

<user-data-constraint>
     <transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>

To achieve this, you must first enable SSL connections in Wildfly. Follow the steps below:

  • Make sure that you have a SSL certificate for Wildfly stored in a keystore. Read more about this in the Wildfly documentation.

  • Edit your Wildfly server configuration file at installdir/wildfly/standalone/configuration/standalone.xml and add a new security realm as shown below:

     <security-realm name="ssl-realm">
      <server-identities>
       <ssl>
        <keystore path="server.keystore" relative-to="jboss.server.config.dir" keystore-password="keystore_password" alias="server" key-password="key_password" />
       </ssl>
      </server-identities>
     </security-realm>
    
  • Modify the default listener in your Wildfly configuration file above:

     <!--<http-listener name="default" socket-binding="http" />-->
     <https-listener name="default" socket-binding="https" security-realm="ssl-realm"/>
    
  • Restart the Wildfly server.

     $ sudo installdir/ctlscript.sh restart wildfly
    

How to configure Apache with Wildfly using SSL?

Using the Bitnami Wildfly Stack, it is possible to have Apache working as a proxy server for Wildfly. If you have followed the steps to enable SSL directly in Wildfly, you must also configure Apache to use the Wildfly SSL port. To do this, follow the steps below:

  • Modify the Apache configuration file for Wildfly at installdir/wildfly/conf/wildfly.conf as shown below.

     SSLProxyEngine On
     SSLProxyVerify none
     SSLProxyCheckPeerCN off
     SSLProxyCheckPeerName off
     SSLProxyCheckPeerExpire off
    
     <Location />
       ProxyPass https://localhost:8443/
       ProxyPassReverse https://localhost:8443/
     </Location>
    

    The example above disables the ProxyVerify and ProxyCheck options because a dummy keystore is in use. If you have certificates provided by a Certificate Authority (CA), those options may be ignored.

  • Restart the server to load the new configuration.

     $ sudo installdir/ctlscript.sh restart apache
    

How to change the Java memory settings for WildFly?

If you find an error similar to this, you will need to increase the Java memory settings for WildFly:

java.lang.OutOfMemoryError: PermGen space

Follow these steps:

Windows

  • Edit the installdir/wildfly/scripts/setenv.bat file and increase the Java settings. For example:

     SET JAVA_OPTS="%JAVA_OPTS% -XX:MaxPermSize=1024m -Xmx1024m"
    
  • Uninstall and install the service again. Run the following commands from an elevated command prompt:

     $ cd installdir
     $ serviceinstall.bat UNINSTALL  (this command will close your current window)
     $ serviceinstall.bat INSTALL
    

How can I run a command in the Bitnami WildFly Stack?

Load the Bitnami Console and then run the command as usual.

How to create a full backup of WildFly?

The Bitnami WildFly Stack is self-contained and the simplest option for performing a backup is to copy or compress the Bitnami stack installation directory. To do so in a safe manner, you will need to stop all servers, so this method may not be appropriate if you have people accessing the application continuously.

NOTE: If you want to create only a database backup, refer to these instructions for MySQL and PostgreSQL.

Backup on Linux and Mac OS X

Follow these steps:

  • Change to the directory in which you wish to save your backup.

     $ cd /your/directory
    
  • Stop all servers.

     $ sudo installdir/ctlscript.sh stop
    
  • Create a compressed file with the stack contents.

     $ sudo tar -pczvf application-backup.tar.gz installdir
    
  • Start all servers.

     $ sudo installdir/ctlscript.sh start
    
  • Download or transfer the application-backup.tar.gz file to a safe location.

You should now download or transfer the application-backup.tar.gz file to a safe location.

Backup on Windows

Follow these steps:

  • Stop all servers using the shortcuts in the Start Menu or the graphical manager tool.

  • Create a compressed file with the stack contents. You can use a graphical tool like 7-Zip or WinZip or just right-click the folder, click "Send to", and select the "Compressed (zipped) folder" option.

  • Download or transfer the compressed file to a safe location.

  • Start all servers using the shortcuts in the Start Menu or the graphical manager tool.

Restore on Linux and Mac OS X

Follow these steps:

  • Change to the directory containing your backup:

    $ cd /your/directory
    
  • Stop all servers.

    $ sudo installdir/ctlscript.sh stop
    
  • Move the current stack to a different location:

    $ sudo mv installdir /tmp/bitnami-backup
    
  • Uncompress the backup file to the original directory:

    $ sudo tar -pxzvf application-backup.tar.gz -C /
    
  • Start all servers.

    $ sudo installdir/ctlscript.sh start
    
IMPORTANT: When restoring, remember to maintain the original permissions for the files and folders. For example, if you originally installed the stack as the root user on Linux, make sure that the restored files are owned by root as well.

Restore on Windows

  • Change to the directory containing your backup:

       $ cd /your/directory
    
  • Stop all servers using the shortcuts in the Start Menu or the graphical manager tool.

  • Uninstall the previous services by executing the following command:

        $ serviceinstall.bat
    
  • Create a safe folder named Backups in the desktop and move the current stack to it. Remember to replace PATH with the right location of your folder:

        $ move installdir \PATH\Backups
    
  • Uncompress the backup file using a tool like 7-Zip or Winzip or just double-click the .zip file to uncompress it, and move it to the original directory.
  • Install services by running the following commands from an elevated command prompt:

      $ cd installdir
      $ serviceinstall.bat INSTALL
    
  • Start all servers using the shortcuts in the Start Menu or the graphical manager tool.

How to debug errors in your database?

The main log file is created at installdir/mysql/data/mysqld.log on the MySQL database server host.

How to debug errors?

The main Wildfly log file is created at installdir/wildfly/standalone/log/wildfly.out.

nativeInstaller

Bitnami Documentation