WildFly

    Bitnami WildFly Stack bundles WildFly Application Server. If you are using Bitnami JBoss please check this documentation.

    Quick reference card

      Cloud Servers Virtual Machines Native Installers
    Configuration file(s) /opt/bitnami/wildfly/standalone/configuration/standalone.xml /opt/bitnami/wildfly/standalone/configuration/standalone.xml install_dir/wildfly/standalone/configuration/standalone.xml
    Log file(s) /opt/bitnami/wildfly/standalone/log/jboss.out /opt/bitnami/wildfly/standalone/log/jboss.out install_dir/wildfly/standalone/log/jboss.out
    Default port 8083 8083 8083
    Management console port 9990 9990 80 (Windows)
    8080 (Linux and Mac OS X)
    System user account wildfly wildfly wildfly
    Service control sudo /opt/bitnami/ctlscript.sh start|stop|restart wildfly sudo /opt/bitnami/ctlscript.sh start|stop|restart wildfly install_dir/ctlscript.sh start|stop|restart wildfly

    How to start/stop the WildFly server?

    If you deployed WildFly using the Bitnami native installers  you can use the Manager Graphical tool.  

    For the the virtual machines and cloud images you can use the "ctlscript.sh" utility which is in the installation directory (/opt/bitnami).

    $ ./ctlscript.sh start wildfly
    

    How to access at WildFly server console?

    For security reasons, the WildFly server console will be accessible only when using 127.0.0.1 as the hostname. If you are using a native installer you can access from your own machine but if you are using a Virtual Machine, Amazon cloud image or Windows Azure cloud image, please check the connection steps below.

    Amazon cloud / BitNami Hosting

    By default WildFly Management Console is not accessible from the outside for security reasons. In order to access it, you can create an SSH tunnel to WildFly Management Console, sending your requests to your webserver from 127.0.0.1 (localhost).

    1. Get your SSH private key if you don't have it already. More info

    2. Create the tunnel.

    - If you are in Linux or Mac you can run the following in a Terminal in your local machine (using your Public DNS instead of xyz.bitnamiapp.com):

    ssh -N -L 9992:127.0.0.1:9990 -i bitnami-hosting.pem bitnami@xyz.bitnamiapp.com
    

    - If you are using Windows, you can use Putty:

    • Follow the steps described here
    • Before opening the connection. Go to Connection -> SSH -> Tunnels, enter the values below and click "Add" button:
      • Source port: "9992"
      • Destination: "localhost:9990" 
    • Click Open

    3. While the tunnel is active you can connect to the web console at http://127.0.0.1:9992/console in your browser. The default login is:

    username/login: manager
    password: <user defined> (default: auto-generated more info)

    Take a look at this link about how to get your application password for BCH servers

     

    Native Installer

    To test your WildFly installation, first make sure that your Apache and WildFly servers are up and running.
     
    To do so, you can use the included "ctlscript.sh" utility. The installdir for Virtual Appliances and AMIs is "/opt/bitnami".
    cd your_installdir
    ./ctlscript.sh status
    

    If you need to start or stop the servers, you just have to follow the steps described here.

    You can access your WildFly Management Console by opening a browser and typing http://127.0.0.1:8080/console or http://127.0.0.1/console.

    The default root user is manager and the password is the same you set during the installation.

    In case you want to access WildFly Management Console from another machine, you have to do two modifications.

    1. Modify the installation_directory/wildfly/conf/wildfly.conf file to add the following line.
    <Location />
        ProxyPreserveHost On
        ProxyPass http://localhost:8090/
    </Location>
    
    1. Modify the WildFly standalone configuration file, installation_directory/wildfly/standalone/configuration/standalone.xml, to allow access to the Management interface to other hosts.
    ...
    <interface name="management">
        <inet-address value="${jboss.bind.address.management:0.0.0.0}"/>
    </interface>
    ...
    

    Finally, restart your servers to load the new configuration

    cd your_installdir
    ./ctlscript.sh restart
    

    Virtual Machine

    If you are running the Virtual Appliance in a secure environment, you can enable the management console by editing the "/opt/bitnami/wildfly/conf/wildfly.conf" file and adding the following line in the <Location> directive

    <Location />
        ProxyPreserveHost On
        ProxyPass http://localhost:8080/
    </Location>
    

    Moreover, you have to modify the WildFly standalone configuration file, installation_directory/wildfly/standalone/configuration/standalone.xml, to allow access to the Management interface to other hosts.

    ...
    <interface name="management">
        <inet-address value="${jboss.bind.address.management:0.0.0.0}"/>
    </interface>
    ...
    

    After that, allow the access to the Management Console port (9990) through the firewall.

    sudo ufw allow 9990
    

    Finally, restart your servers to load the new configurations:

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

    Then you can access at the same URL with "/console", for example http://YOUR_IP/console

    The default root user is manager. For Virtual Appliances the password is bitnami

    Azure cloud

    By default WildFly Management Console is not accessible from the outside for security reasons. In order to access it, you can create an SSH tunnel to WildFly Console, sending your requests to your webserver from 127.0.0.1 (localhost).

    You should follow these steps to create the tunnel:

    1. Create the tunnel.

    - If you are in Linux or Mac you can run the following in a Terminal in your local machine (using your Public DNS instead of xyz.bitnamiapp.com):

    $ ssh -N -L 9992:127.0.0.1:9990 your_azure_user@xxx.cloudapp.com
    

    - If you are using Windows, you can use Putty:

    • Follow the steps described here
    • Before opening the connection. Go to Connection -> SSH -> Tunnels, enter the values below and click "Add" button:
      • Source port: "9992"
      • Destination: "localhost:9990" 
    • Click Open

    2. While the tunnel is active you can connect to the WildFly Management Console through http://127.0.0.1:9992:consolein your browser. The default login is:

    username/login: manager
    password: <user defined> (default: auto-generated more info)

    Tabs end

    How is Apache server connected with WildFly?

    Bitnami Stacks ship Apache server. There are different ways to connect these two servers. One of this is connecting through HTTP proxy.

    The HTTP Connector element represents a Connector component that communicates with a web connector via the HTTP protocol. This is used for cases where you wish to invisibly integrate WildFly  into an Apache installation, and you want Apache to handle the static content contained in the web application, and/or utilize Apache's SSL processing.

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

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

    In Bitnami WildFly Stack WildFly HTTP listens at port 8090 and in Bitnami Cloud Hosting it listens at port 8083 by default and a connector is configured to make the application accessible at http://localhost:PORT and http://xyz.bitnamiapp.com/wildfly/ respectively.

    How to enable SSL in Wildfly server?

    Take into account that Bitnami uses Apache as Proxy server in front of Wildfly. To learn how to configure Apache and Wildfly for SSL, go to the next section.

    This section could be useful if your application includes something similar to this in the web.xml file, which means that you are forcing secure connections to Wildfly.

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

    First of all, make sure you have a SSL certificate for Wildfly stored in a keystore. You can find more information in the Wildfly official site

    https://docs.jboss.org/author/display/WFLY8/Security+Realms

    Once it is done, you have to edit your Wildfly server configuration file and add a new security-realm (change path to your own path if it is not in /opt/bitnami/wildfly/standalone/configuration)

    /opt/bitnami/wildfly/standalone/configuration/standalone.xml

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

    Also you have to modify the default listener in your Wildfly configuration (same file as above)

    <!--<http-listener name="default" socket-binding="http" />-->
    <https-listener name="default" socket-binding="https" security-realm="ssl-realm"/>
    

    Then restart the Wildfly server

    sudo /opt/bitnami/ctlscript.sh restart wildfly
    

    How to create a SSL certificate for Wildfly?

    The steps required to create a self-signed certificate for Wildfly are explained below. Change /opt/bitnami for your application directory if you are using a native installer. The chown command is only necessary in VMs, Cloud Images and if you installed the stack as root user.

    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 configure Apache with Wildfly using SSL?

    Using Bitnami Wildfly, you have Apache working as a Proxy server for Wildfly. If you just want to configure HTTPS in your server, you can follow the steps in the Apache How to enable SSL access section.

    If you have followed the steps above to enable SSL directly in Wildfly, you need to tell Apache to use the Wildfly SSL port. To do it, modify Apache configuration file for Wildfly. In this example, we are disabling ProxyVerify and ProxyCheck because we are using a dummy keystore, but if you are using certificates provided by a Certificate Authority you don't need to add those lines.

    /opt/bitnami/wildfly/conf/wildfly.conf

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

    Don't forget to restart the server to load the new configuration

    sudo /opt/bitnami/ctlscript.sh restart apache
    
     

    How to change the Java memory settings for WildFly?

    If you find an error similar to this, the problem is that you need to increase the Java memory settings for WildFly.

    java.lang.OutOfMemoryError: PermGen space
    

    You can find below the steps to increase Java settings on your side:

      win_platform.png On 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" 
    

    Then it is necessary to uninstall and install the service again. Open a command prompt as administrator and run the following commands:

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

    How to debug errors?

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

    Tag page (Edit tags)
    • No tags
    Pages that link here
    Page statistics
    20289 view(s), 32 edit(s) and 20994 character(s)

    Comments

    You must login to post a comment.

    Attach file

    Attachments