Install Java and WildFly
https://prabg.wordpress.com/2018/04/07/jboss-wildfly-as-setup-on-raspberry-pi-3/
You'll need
Linux ARM 32 Hard Float ABI
(32 bit JDK 8)
and
WildFly 11.0
Considering that we're installing the server to run with JDK 8 32-bit, you should also develop your REST API with the 32-bit JDK 8
- Copy via FileZila the WildFly 11.0 zip and the ARM jdk 1.8.2 tar.gz to the Pi's desktop
- On the Pi, navigate to the Desktop and rename both files to
wildfly_11.zipandjdk_1.8.2.tar.gz -
Extract both files to the
/optdirectory and check the contents of/opt:$ sudo unzip ~/Desktop/wildfly_11.zip -d /opt $ sudo tar -xzvf ~/Desktop/jdk_1.8.2.tar.gz -C /opt $ cd /opt $ ls -
Navigate to the
/homedirectory and open.bashrcwithgedit...
...and add the following code to the end of the file:$ cd ~ $ sudo gedit .bashrc
make sure the paths match the directories you just listedexport JAVA_HOME=/opt/jdk1.8.0_221 export JBOSS_HOME=/opt/wildfly-11.0.0.Final export PATH=$JAVA_HOME/bin:$PATH - Save and close
gedit -
Run the following command to refresh the
PATH$ source ~/.bashrc -
Test that Java was installed correctly by running the following command:
It should display the following:$ java -versionJava(TM) SE Runtime Environment (build 1.8.0_221-bll) ... -
Start the WildFly server by running this script:
$ cd $JBOSS_HOME $ sudo ./bin/standalone.sh -
Open your browser and navigate to localhost:8080 (or whichever port you specified)
If the WildFly page opens, your server is running
If you need to change the port that WildFly is using edit the
$JBOSS_HOME/standalone/configuration/standalone.xml file
Start the Server on Boot
Optional
-
Create a shell script that starts the server:
...and add the following:$ cd /etc/systemd/system $ sudo touch server_startup.sh $ sudo gedit server_startup.sh
Save the file and quit#!/bin/sh# source ~/.bashrc source $JAVA_HOME source $JBOSS_HOME # Start the WildFly server $JBOSS_HOME/bin/standalone.shgedit -
Create a service that runs on boot:
...and add the following:$ sudo touch server_startup.service $ sudo gedit server_startup.service[Unit]Description=JBOSS startup script[Service] ExecStart=/usr/local/etc/server_startup.sh [Install] WantedBy=multi-user.target
Add a User
You'll have to setup a user to be able to access the WildFly administration page
-
Navigate to
$JBOSS_HOME/binand run theadd-user.shshell script:$ cd $JBOSS_HOME/bin $ sudo ./add-user.sh -
The script will prompt you for the type of user you'd like to create - Management or Application
Choose Management User -
Choose a Username - we'll use admin
though you'd probably want to choose something more secure - Choose a Password and re-enter it
- The script will prompt you to join groups - simply hit Enter
- The script will ask for your confirmation - type yes to confirm
- The script will ask if the user will be used to connect accross the application server processes - type no
-
Open your browser and navigate to localhost:8080 (or whichever port you specified)
Click the link Administration Console and type in the user credentials you just set up - From here you can Deploy Applications, Monitor the Server, Configure Settings, and Manage User Permissions
Enable Remote Access
By default, WildFly 11 is setup to only allow local access. To enable remote access, navigate to the
configuration directory and edit the standalone.xml file:
$ cd $JBOSS_HOME/standalone/configuration
$ sudo gedit standalone.xml
Locate the part of the file that defines the interface -> address and change it from this:
<interface name="management">
<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
<interface />
<interface name="public">
<inet-address value="${jboss.bind.address:0.0.0.0}"/>
<interface />
...to this:
<interface name="management">
<any-address />
<interface />
<interface name="public">
<any-address />
<interface />
Save your changes and restart WildFly