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
— Change configuration file name in order to run full Java EE 7 Stack
JBOSS_CONFIG=standalone-full.xml
# STARTUP_WAIT=60
–Probably overkill wait time
STARTUP_WAIT=120
# SHUTDOWN_WAIT=60
–Probably overkill wait time
SHUTDOWN_WAIT=120
# 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.
[…] notes below presume you followed my directions for installation found here or have already successfully installed WildFly on your […]
LikeLike
Failed to start wildfly.service: Unit wildfly.service not found.
Found the above error after executing service wildfly start.
any suggestions?
LikeLike
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;
}
}
LikeLike
Great guide. I used it to install 9.0.0.CR2 and the only difference is in the port listening. I changed standalone.xml to
(removing the ${jboss.bind.address.unsecure:} part because it wouldn’t work for me.
I am going to try this SO solution since it seems a little more official.
http://stackoverflow.com/questions/10132657/jboss-as-7-not-accepting-remote-connections
LikeLike
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
LikeLike
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
LikeLike
sudo -s
should should work with no arguments
sudo -i is good also
Good catch on the others.
Thanks Raja!
Dennis
LikeLike
Raja:
Updated the original post to include your fixes. Thanks again.
dennis
LikeLike
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.
LikeLike
Hi Gerald:
I put in a bug report on this a while back when I updated to Ubuntu 15.04. Not sure if it will get fixed by the final release of version 10.
https://issues.jboss.org/browse/WFLY-4570
Cordially,
Dennis
LikeLike
i love u
LikeLike
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?!
😦
LikeLike
[…] First i’m looking for the documentation here, but its too old and to little information about how to install and config the Application Server for new comer like me. So i’m surfing on a few blogs and i found 1 simple but clean tutorial how to install Wildfly on ubuntu here. […]
LikeLike
I actually just put up a bunch (about 7) new posts here: https://gesker.wordpress.com/2016/02/ on Ubuntu 15.10 and WildFly 10 along with integration with PostgreSQL.
LikeLike
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 ?
LikeLike
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.
LikeLike
Found an error after executing, service wildfly start:
Failed to start wildfly.service: Unit wildfly.service not found.
any suggestions?
LikeLike