3. Running DynFi on any operating system

DynFi has two external dependencies. In order to make it run:

  • Java >= 8 has to be installed on the machine where DynFi is supposed to run,
  • MongoDB >= 3.4 has to be available from the machine where DynFi is supposed to run (can be the same, but can also be available over the network).

Please note that DynFi is released for Debian and Ubuntu operating systems in a way which provides easy/automated updates (thanks to APT) and also systemd scripts. (See Installing DynFi on Ubuntu.)

However, you can run DynFi manually (or create your own “startup scripts”) in any OS as long as it meets dependencies listed above.

To download DynFi’s dynfi-version.jar file, browse dynfi.com. Of course, instead of the version in the file name, there should be an actual version.

This single JAR file contains DynFi’s server and DynFi’s Web User Interface. Except Java >= 8 and MongoDB >= 3.4 nothing else should be needed to run DynFi using this JAR file.

3.1. Running DynFi on Windows

Through not recommended, it is possible to run DynFi on Windows.

In this example DynFi ix going to connect to local MongoDB (by default).

Thus, having both Java 8 and MongoDB installed on the machine, DynFi can be started like this:

java -jar dynfi-version.jar

(Of course the actual file name should be used instead of dynfi-version.jar file as above.)

This should start DynFi and bind it to all IP addresses available, especially 127.0.0.1. The output should be similar to the image below (after the custom SSL certificate is accepted):

_images/windows_05.png

Running DynFi on Windows

As seen in the image, due to lack of default log directory, DynFi prints all logs to standard output. This can be easily changed be creating a (sub)directory for DynFi to write its logs:

mkdir logs

Before starting again, an environment variable can also be set to configure DynFi not to use HTTPS, like this:

SET useHttps=false

When starting again, one can specify the newly created logs (sub)directory as the directory where DynFi should write its logs (instead of the console):

java -DLOG_DIR=logs -jar dynfi-version.jar

This way DynFi’s WUI can be accessed using e.g. http://127.0.0.1 from the same machine and instead of printing logs to console, will write them to logs/dynfi.log, as shown below.

_images/windows_06.png

Running DynFi on Windows

Of course, various options can be written to config file, as described in Configuration chapter. For tuning logs, refer to Logs.

3.2. Running DynFi on FreeBSD

The following example shows how to quickly run DynFi on FreeBSD 11.

In this example DynFi is going to connect to remote MongoDB running on host 192.168.10.64.

To install Java 8 on FreeBSD, please follow FreeBSD Documentation. To install OpenJDK8, one should basically call in terminal:

sudo pkg install openjdk8

And follow the procedure.

In case MongoDB should be installed locally, this is possible with:

sudo pkg install mongodb34
sudo echo mongod_enable=\"YES\" >> /etc/rc.conf
sudo service mongod start

If Java 8 is installed and recent dynfi.jar file is downloaded to current directory, DynFi can be started like this (it should connect to MongoDB on localhost):

java -jar dynfi-version.jar

(Of course the actual file name should be used instead of dynfi-version.jar file as above.)

This should start DynFi and bind it to all IP addresses available, especially 127.0.0.1. The output should be similar to the image below (after accepting custom certificate with security exception).

_images/freebsd_no_default_log_dir.png

Running DynFi on FreeBSD 11.1 without default log directory

As seen in the image, due to lack of default log directory, DynFi prints all logs to standard output. This can be easily changed by creating the default directory for DynFi to write its logs:

mkdir /var/log/dynfi

When starting again, one can also specify precise IP address (192.168.10.50 in this very example) and port (443, default for HTTPS) DynFi should bind to. This way DynFi can be started using:

ipAndPort=192.168.10.50:443 java -jar dynfi-version.jar

This way DynFi’s Web User Interface can be accessed using https://192.168.10.50 address in browser and instead of printing logs to standard output, will write them to /var/log/dynfi/dynfi.log, as shown below.

_images/freebsd_default_log_dir_custom_ip.png

Running DynFi on FreeBSD 11.1 bound to one IP address

If MongoDB is not available on localhost and cannot be installed on localhost (due to whatever reason), it has to be available somewhere in the network. Then mongoClientUri can be used to configure DynFi so it will connect to remote MongoDB, installed on 192.168.10.64 in this very example:

mongoClientUri=mongodb://192.168.10.64 java -jar dynfi-version.jar
_images/freebsd_remote_mongo.png

Running DynFi on FreeBSD 11.1 with MongoDB installed remotely

Of course, various options can be written to config file, as described in Configuration chapter. For tuning logs, refer to Logs.