WildFly 8.2.0 on Ubuntu 14.04

These are my notes for installing JBoss WildFly 8.2 on Ubuntu 14.04. These notes make the presumption you already have the Java JDK install on your system.

Elevate to root
sudo -s (or sudo -i)
cd /opt

Create a user acount on the system for wildfly
adduser --no-create-home --disabled-password --disabled-login wildfly

Download WildFly
wget http://download.jboss.org/wildfly/8.2.0.Final/wildfly-8.2.0.Final.tar.gz

Extract WildFly
tar -xzvf wildfly-8.2.0.Final.tar.gz

Make a symbolic link to new folder
ln -s wildfly-8.2.0.Final wildfly

change ownership of directory and symbolic link to wildfly
chown -R wildfly.wildfly wildfly
chown -R wildfly.wildfly wildfly-8.2.0.Final

Now, while WildFly 8 doesn’t ship as a .deb (which would be awesome!) it does provide a scripts to get you setup on Debian like/based systems of which Ubuntu is one. So, let’s edit and make use of those scripts:
cd /opt/wildfly/bin/init.d

Edit the file that contains the settings/options for the setup script:
wildfly.conf

Uncomment and Edit the following lines:
# JBOSS_HOME="/opt/wildfly"
JBOSS_HOME="/opt/wildfly"

# JBOSS_USER=wildfly
JBOSS_USER=wildfly

# JBOSS_MODE=standalone
JBOSS_MODE=standalone

# JBOSS_CONFIG=standalone.xml
JBOSS_CONFIG=standalone-full.xml
— Change configuration file name in order to run full Java EE 7 Stack

# STARTUP_WAIT=60
STARTUP_WAIT=120
–Probably overkill wait time

# SHUTDOWN_WAIT=60
SHUTDOWN_WAIT=120
–Probably overkill wait time

# JBOSS_CONSOLE_LOG="/var/log/wildfly/console.log"
JBOSS_CONSOLE_LOG="/var/log/wildfly/console.log"

OK now let’s link to these files from the approprate place in /etc
cd /etc/default
ln -s /opt/wildfly/bin/init.d/wildfly.conf wildfly

cd /etc/init.d
ln -s /opt/wildfly/bin/init.d/wildfly-init-debian.sh wildfly

Try to start WildFly as a service
service wildfly start

Which should give you output similar to…
* Starting WildFly Application Server wildfly [OK]

Run update-rc.d to ensure wildfly starts on reboot
cd /etc/init.d
update-rc.d wildfly defaults

By default WildFly seems to only listen on 127.0.0.1. To make it listen on all interfaces we have to edit the standalone-full.xml (recall we changed the configuration file form standalone.xml to standalone-full.xml above) file and change each instance of “127.0.0.1” to “0.0.0.0” in the file. Just use find and replace in your editor to do this. I use vim so…

cd /opt/wildfly/standalone/configuration
vi standalone-full.xml
:%s/127.0.0.1/0.0.0.0/g
:wq

Start or restart Wildfly
service wildfly stop
service wildfly start

With WildFly running add a “Management User”
cd /opt/wildfly/bin
./add-user.sh

That’s it. You now have a basic WildFly 8 install and can reach it and configure further with any browser using the “Management User” credentials you setup above.

17 thoughts on “WildFly 8.2.0 on Ubuntu 14.04

    • Failed to start wildfly.service: Unit wildfly.service not found.
      Found the above error after executing service wildfly start.

      any suggestions?

      Like

  1. thanks a lot!
    that made things really easy for me.

    depending on your upstart config:
    instead of service start wildfly
    use service wildfly start

    I’d like to add:
    – Standard-Port(8080) can be changed via port-offset in standalone(-full).xml,
    so the standard-portnumbers are increased by the given value (default:0)

    – then if you’d like to use nginx (instead of iptables) as a forwarder:

    server {
    server_name {your.server.name};
    location / {
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Server $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass http://localhost:8180;
    }
    }

    Like

    • Nathaniel:

      Just started playing with 9.0.0.CR2 myself. Looks like those guys over at the WildFly project are working hard to get a new stable revision out. Got to admit though, I’m still getting used to WildFly after using GlassFish for so long.

      Nothing bad mind you they just have their differences. I think some of the behavior differences between Hibernate and Eclipselink have been the biggest items.

      Good luck with your project!

      Dennis

      Like

  2. Very accurate info.. few typos..

    Elevate to root
    sudo -s root

    this is not working, use

    sudo -i

    typoes of

    service stop wildfly
    service start wildfly

    to

    service wildfly stop
    service wildfly start

    Like

  3. If you are running Debian Jessie, don’t use symlinks from /etc/init.d and /etc/defaults to the scripts in /opt/wildfly/bin/init.d.

    Copy them instead.

    I have spent 4 hours trying to understand why I could not get Wildfly to start on reboot. I copied the files instead instead of symlinks, then it worked.

    Maybe it has something to do with the way systemd interprets the sysvinit scripts.

    Like

  4. root@myMachine:# cd /opt/wildfly/bin/init.d
    bash: cd: /opt/wildfly/bin/init.d: No such file or directory

    ubuntu 14.04 … now what?!

    😦

    Like

  5. hello gesker for time to time when trying to reload wildfly after deploy puts wildfly in unresponsive state did you come across to this problem ?

    Like

    • I’m sorry. I haven’t. But since this posting I’m now on Ubuntu 15.04, OpenJdk 8 and WildFly 10 an its been pretty quick and stable.

      Like

  6. Found an error after executing, service wildfly start:
    Failed to start wildfly.service: Unit wildfly.service not found.

    any suggestions?

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s