Installation

Requirements

  • JRE 1.7+ for HFS client.
  • JRE 1.7+ for HFS server.

Latest Oracle Java 1.8 update is recommended.

Installation

  • Download, verify and unpack hfs-server-bundle.zip archive.
  • Ensure you have JRE or JDK installed and 'java' executable is pointing to the correct Java installation directory.

Windows

  • install HFS server service with bin/HFS-service-install.cmd script;
  • run HFS server as a console application with bin/HFS.exe or
  • run HFS server as a service with Windows tools.

Windows executables are based on commons-daemon procrun tool.

Unix

  • run HFS server as a console application with bin/HFS.sh script or
  • run HFS server as a daemon with bin/HFS-start.sh script (requires jsvc tool).

Unix daemon executables are based on commons-daemon jsvc tool.

Windows: start console application

> bin/HFS-service-install.cmd
> bin/HFS.exe
Starting server...
Server has been started on port 80.
Press 'Ctrl+C' to stop server.

Check HFS server is started - open welcome page: http://localhost

^C
Stopping server...
Server has been stopped.

Windows: start daemon service

> bin/HFS-service-install.cmd
> net start HFS

Check HFS server is started - open welcome page: http://localhost

> net stop HFS

Unix: start console application

$ ls
CHANGES LICENSE README  bin     conf    lib     webapps work
$ cd bin && ls
HFS-check.sh    HFS-service-install.cmd   HFS-start.sh    HFS.exe    HFSw.exe    ia64
HFS-jsvc.sh     HFS-service-remove.cmd    HFS-stop.sh     HFS.sh     amd64       unix
$ which java && java -version
/usr/bin/java
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
$ ./HFS.sh 
usage: java -jar hfs-server.jar [--port <num>] [--config <path>] [--start | --help | --version]
...
$ ./HFS.sh --start --port 8080
Starting server...
Server has been started on port 8080.
Press 'Ctrl+C' to stop server.

Check HFS server is started on port 8080 - open welcome page: http://localhost:8080

^C
Stopping server...
Server has been stopped.
$ sudo sh ./HFS.sh --start --port 80
Starting server...
Server has been started on port 80.
Press 'Ctrl+C' to stop server.

Check HFS server is started on privileged port 80 - open welcome page: http://localhost

^C
Stopping server...
Server has been stopped.

Unix: start daemon service

$ ls
CHANGES LICENSE README  bin     conf    lib     webapps work
$ cd bin && ls
HFS-check.sh    HFS-service-install.cmd   HFS-start.sh    HFS.exe    HFSw.exe    ia64
HFS-jsvc.sh     HFS-service-remove.cmd    HFS-stop.sh     HFS.sh     amd64       unix
$ vim HFS-jsvc.sh
...
JAVA_HOME=... # Set variable to point correct Java installation
...
$ ./HFS-check.sh -showversion
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
commons daemon version "1.0.16a"
commons daemon process (id: 15050, parent: 15048)
Service "com.ursaj.hfs.console.HfsDaemon" checked successfully
Exit code: 0
$ touch out.txt
$ sudo ./HFS-start.sh 
Exit code: 0
$ tail -3 out.txt
Initializing server...
Server initialized.
Server started.

Check HFS server is started on privileged port 80 - open welcome page: http://localhost

$ sudo ./HFS-stop.sh 
Exit code: 0
$ tail -3 out.txt
Server stopped.
Destroying server...
Server destroyed.

Unix: build jsvc tool

$ ls
CHANGES LICENSE README  bin     conf    lib     webapps work
$ cd bin/unix && ls
jsvc-home.url jsvc-src.tgz
$ tar -zxf jsvc-src.tgz 
$ cd jsvc-src && ls
CHANGES.txt  INSTALL.txt  Makedefs.in  Makefile.in  configure    configure.in man          native       support
$ less INSTALL.txt 
$ export JAVA_HOME=/usr/local/jdk1.7
$ ./configure
...
*** All done ***
Now you can issue "make"
$ make
...
gcc   jsvc-unix.o libservice.a  -o ../jsvc
$ cp jsvc ../../jsvc
$ ../../HFS-check.sh -version
...
commons daemon version "1.0.16a"
commons daemon process (id: 18694, parent: 18692)
Exit code: 0

Read more