-
Notifications
You must be signed in to change notification settings - Fork 47
Installation guide (for pre packaged releases)
It is important that those who setup a Hajk-based solution have a clear understanding of the following.
Hajk consists of three technically separate applications that work together to provide a full-fledged experience to both users and administrators:
- Client (the web map front end)
- Admin (a frontend for Client's configuration files)
- Backend (historically called Mapservice, which is the backend server application which has a REST API)
Hajk can run on any operating system and architecture where NodeJS is available.
Furthermore, there is a Windows-specific IIS-only backend.
In addition, Hajk is also provided as a Docker container. For more information, see the upcoming section.
Finally, there is a Simple edition of Hajk, where Admin and Backend are not used and the only active component is the Client app. In this configuration, Hajk is just a directory of static HTML, JS and CSS and can be delivered to the user's browser using any HTTP server.
The following options are available when installing Hajk:
- The NodeJS edition. This is the recommended way edition for installing Hajk in new environments. The Backend has been rewritten from scratch in JS. It can be deployed on any platform supported by NodeJS and supports additional features that are not available in the other editions.
- The .NET edition. The original edition. Requires Windows and IIS.
- The Simple edition. A way to install Hajk without actually installing anything. Just put the static files on a web server, do necessary adjustments in some JSON files and you're good to go. This edition does not contain Admin and Backend application and is therefore recommended for basic installations only.
Ensure that you've decided which Hajk edition suits your needs. For details, please refer to the previous section.
Go to the Hajk releases page and download the appropriate edition for the latest release.
Depending on your choice in step 1, refer to the relevant section below.
Pre-requirements: Any OS with Node 12 or greater.
Please note: the instructions below assume Hajk release 3.5. Make sure to replace the version with the one you've downloaded wherever applicable.
- Unpack the zip file
cd hajk-v.3.5.0-nodejs
npm install
node index.js
- Go to
localhost:3002
for the client app - Administration: use the full-fledged admin UI located on
localhost:3002/admin
. (There's even an API explorer, check outlocalhost:3002/api-explorer
for the OpenAPI Specification of backend.) - For information on fine-tuning the setup, please refer to the following section.
Pre-requirements: Any OS, any web server
- Unpack the zip file
- Copy the contents of
hajk-v.3.5.0-simple
directory to your web server of choice - Hajk is now available on the specified path/port of your web server (refer to your web server's setup)
- Administration: edit the
simpleMapConfig.json
andsimpleLayersConfig.json
to configure your map
Pre-requirements: Windows with IIS
- Download the latest release of .NET edition from here.
- Unpack the zip-file to a folder, e.g.
D:\hajk
- Go to IIS
- Create a new website, point it to
D:\hajk
as root - Convert
admin
andmapservice
to IIS applications (by right-clicking and selecting "Convert to application") - Launch your server and navigate to
localhost
(or whatever your binding for the website is, in IIS). You should see theclient
application spinning up. (If not, see Troubleshooting below.) - The other applications are located in their respective directories, so if
client
is onlocalhost
, you can reachadmin
onlocalhost/admin
andmap service
onlocalhost/mapservice
. -
Fine-tune the
admin
application. Themapservice
application must have sufficient permissions to change files in the/mapservice/App_Data
directory. This is done by giving the user that runs the IIS Application Pool (by defaultIIS_IUSRS
)modify
permission on the directory. - It's recommended to restrict access to the
admin
application. One way to achieve it is to use IIS's built in Authentication module. DisableAnonymous Authentication
and enable your authentication method of choice, such asWindows Authentication
. Now users who try to reach thelocalhost/admin
endpoint will be prompted to login in with a valid Windows username and password. - For information on fine-tuning the setup, please refer to the following section.
The Backend of the NodeJS edition is controlled by the settings in the .env
file. The file is well-commented and it's recommended that you take some time to review the options available. If unsure, it's fine to leave the defaults.
If you've followed the instructions so far, you can verify that the Backend is up and running by navigating to http://localhost:3002
. (If you wish to change the port, see .env
.)
One particularly nice feature that only exists in the NodeJS edition is the API explorer. It is available on http://localhost:3002/api-explorer/
. For production servers, it is recommended that you disable this functionality (again, see .env
).
The .NET edition's Backend is an IIS application and can be controlled via the IIS Control Panel and the Web.config
file.
The Simple edition does not contain the Admin and Backend applications, hence the post-install fine-tuning is limited to configuring the Client application and its layers. That can be done in the layers.json
and map_1.json
files.
A simple way to get Hajk up and running is to use a docker image. The images can be fetched from Docker Hub.
Fetch either the latest image, or a specifik release and follow the instructions on Docker Hub to get everything up and running.
As mentioned in the previous sections, Hajk consists of three separate applications: Client, Admin and Backend.
Client and Admin communicate with the Backend using an API. In order for the communication between the applications to work, the two front-end applications must know where to find the Backend, i.e. which machine is hosting the backend and on which port. That setting is controlled in the appConfig.json
for the Client and in config.json
in for the Admin.
The most frequent problems when setting up Hajk are related to the different parts of Hajk not being able to communicate with each other. To debug, launch Developer tools in your browser and go to the Network tab. Reload the website. Client will request two files from mapservice
on load: layers
and map_1
. By default mapservice
is located directly under web root, but if your setup varies, make sure to point to the proper mapservice
application by editing client\appConfig.json
. The same should be done for admin
in admin\config.json
.