Bitnami WildFly Virtual Machine

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! This guide includes some basic information you will need to get started with your application.

How to import a Bitnami Virtual Machine?

Check the following instructions to import a Bitnami Virtual Machine:

Importing a Bitnami Virtual Machine in VirtualBox
  • Select the "File -> Import Appliance" menu option and select the .ova file downloaded from the Bitnami website. Then click "Continue".
  • Once it is imported, click the "Start" button in the VirtualBox toolbar.

For a detailed walkthrough, check our Virtualbox tutorial.

Importing a Bitnami Virtual Machine in a VMware product
  • Select the "File -> Import" menu option and select the .ova file downloaded from the Bitnami website. Then click "Continue".
  • Once the import is complete, click "Finish" to start the virtual machine.

For a detailed walkthrough, check our VMware tutorial, which uses VMware Fusion as an example. To learn how to use our virtual machines with other VMware products, refer to the VMware Workstation documentation or the VMware vSphere documentation.

What credentials do I need?

You need two sets of credentials:

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

  • The server credentials, consisting of an SSH username and password. These credentials allow you to log in to your Virtual Machines server using an SSH client and execute commands on the server using the command line.

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

Username: manager

What is the administrator password?

Password: The administrator password to log in to your application is randomly generated during the first boot. Check the FAQ to learn how to retrieve it.

What SSH username should I use for secure shell access to my application?

SSH username: bitnami

What is my server IP address?

The IP address is displayed on screen at the end of the boot process, but you can check it at any time by running the following command:

  $ sudo ifconfig

Check server IP address

How do I get my SSH key or password?

You can obtain the SSH password from the virtual machine console when it starts up. Click here for more information.

How to start or stop the services?

Each Bitnami stack includes a control script that lets you easily stop, start and restart services. The script is located at /opt/bitnami/ctlscript.sh. Call it without any service name arguments to start all services:

$ sudo /opt/bitnami/ctlscript.sh start

Or use it to restart a single service, such as Apache only, by passing the service name as argument:

$ sudo /opt/bitnami/ctlscript.sh restart apache

Use this script to stop all services:

$ sudo /opt/bitnami/ctlscript.sh stop

Restart the services by running the script without any arguments:

$ sudo /opt/bitnami/ctlscript.sh restart

Obtain a list of available services and operations by running the script without any arguments:

$ sudo /opt/bitnami/ctlscript.sh

What are the default ports?

A port is an endpoint of communication in an operating system that identifies a specific process or a type of service. Bitnami stacks include several services or servers that require a port.

Remember that if you need to open some ports you can follow the instructions given in the FAQ to learn how to open the server ports for remote access.

Port 22 is the default port for SSH connections.

Bitnami opens some ports for the main servers. These are the ports opened by default: 80, 443.

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 /opt/bitnami/apache2/conf/httpd.conf and then configure the ProxyPass directive in the /opt/bitnami/wildfly/conf/wildfly.conf file.

For more information, refer to these instructions.

How to access the WildFly server console?

For security reasons, the WildFly server console will be accessible only when using 127.0.0.1 as the hostname. To access the server console, it is necessary to create an SSH tunnel by forwarding port 9990 on the WildFly server to port 9990 on the local host.

An example of configuring the SSH tunnel using PuTTY on Windows is displayed below.

PuTTY tunnel config

While the tunnel is active, you should be able to access the server console through the secure SSH tunnel you created, by browsing to http://127.0.0.1:9990/console.

Refer to the FAQ for platform-specific instructions to create the SSH tunnel.

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 bitnami.

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 /opt/bitnami/apache2/conf/httpd.conf. Then, add the following lines to the /opt/bitnami/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 /opt/bitnami/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 /opt/bitnami/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 /opt/bitnami
     $ 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: Making this application's network ports public is a significant security risk. You are strongly advised to only allow access to those ports from trusted networks. If, for development purposes, you need to access from outside of a trusted network, please do not allow access to those ports via a public IP address. Instead, use a secure channel such as a VPN or an SSH tunnel. Follow these instructions to remotely connect safely and reliably.

How to reset the MariaDB root password?

Please note that depending on the version you have installed, you may find the MariaDB files at /opt/bitnami/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 /opt/bitnami/ctlscript.sh stop mariadb
    
  • Start MariaDB with the following command:

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

     $ sudo /opt/bitnami/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:

$ /opt/bitnami/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 /opt/bitnami/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 /opt/bitnami/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 /opt/bitnami/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 /opt/bitnami/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 /opt/bitnami/ctlscript.sh restart apache
    

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

Log in to the server console as the bitnami user and run the command as usual. The required environment is automatically loaded for the bitnami user.

How to create a full backup of WildFly?

Backup

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.

Follow these steps:

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

      $ cd /your/directory
    
  • Stop all servers:

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

      $ sudo tar -pczvf application-backup.tar.gz /opt/bitnami
    
  • Restart all servers:

      $ sudo /opt/bitnami/ctlscript.sh start
    

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

Restore

Follow these steps:

  • Change to the directory containing your backup:

      $ cd /your/directory
    
  • Stop all servers:

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

      $ sudo mv /opt/bitnami /tmp/bitnami-backup
    
  • Uncompress the backup file to the original directoryv

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

      $ sudo /opt/bitnami/ctlscript.sh start
    

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

How to debug errors in your database?

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

How to debug errors?

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

virtualMachine

Bitnami Documentation