Friday, October 21, 2016

WildFly 10. Getting started on Windows

                 WildFly is a JBOSS application server which is one of the most popular frameworks to run your web application and to connect database there.

I'm using Windows 10 home edition, but I'm prettu sure same steps are going to work with Windows 7 and Windows 8 as well.

To setup WildFly:
1. Go to the official download page;
2. Choose the latest version .zip (for windows);
3. Unpack it whereever you want in your computer (keep remember where).
4. Install Java Development Kit (JDK) which wildfly uses
5. (Optional) It's useful to set up enviroment variable for your wildfly directory %WILDFLY_HOME% and %JAVA_HOME% - path to your jdk folder. I will use those variables here in the text if I need to show where the file is.

Now we could be ready to start the server, but I highly recomment to make some additional steps.
WildFly opens a new port (8080) where it runs and the other port (9990) where it runs the application.

There are two default ports for most of applications you are running everytime (for example I had a NIVIDIA driver at 9990 port which supported my videocard, so I couldn't relocate it.

(How to know which ports are busy)

That's why my preposition is to change default wildfly portsat the very beginning just for sure.

At the %WILDFLY_HOME%\standalone\configuration we can find config file standalone.xml.
If we open it to modify we can find there:

        <socket-binding name="http" port="${jboss.http.port:8080}"/>

and

        <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>

All we need is to change 8080 for 8081 and 9990 for 9991 (or any ports which are not open by the other applications). We change port numbers right here in the file and save changings.

Also we need to modify same way

%WILDFLY_HOME%\domain\configuration\host.xml

and

%WILDFLY_HOME%\domain\configuration\host-master.xml

There we find only the 9990 settings.

Now we are completely ready to start the server. For this:
1. From command prompt type

%WILDFLY_HOME%\bin\standalone.bat

2. Or from file system go %WILDFLY_HOME%\bin\ , then run standalone.bat by double mouse clicking.


After all you have an access to the http:\\localhost:8081.
There you can find a link "Administration console" where you cal also access by the link http://localhost:9991/console/

For now there you will se the ERROR window. It happened because we didn't setup any user yet.
To do it we can use provided script add-user.bat in \bin folder

Open new command prompt window (the same as previous) and type there

%WILDFLY_HOME%\bin\add-user.bat

Command prompt is gonna ask
What type of user do you wish to add?
 a) Management User (mgmt-users.properties)
 b) Application User (application-users.properties)
(a):

For now we need a management user so we push ENTER

Then we follow the instructions and setting up username

manager

And password

manager

It's enough for today and now we can follow the link for "Administration console" again. This time browser's asking us for username and password and if we remember both correct, we are able to see the main administration menue.






















To stop the server we can type CTRL + c in command prompt, then type Y.

How to write service application to run on this sever will see in the next posts.

No comments:

Post a Comment