WebHare for development

This manual will explain how to setup a local WebHare installation for development and will guide you through building a website. We will be using Docker to manage the WebHare installation.

Docker limitations

Please note that Docker has some limitations (especially on Mac and Windows) in performance and ease of development that you wouldn’t see on a production WebHare installation, but gives a much easier setup experience. All production WebHare setups are generally done in Docker on a Linux (virtual) machine.

If you have sufficient experience manually maintaining and compiling software, you can alternatively install WebHare from source.

Installing WebHare

First, install Docker from https://www.docker.com/get-started.

On Windows

Run the following commands:

mkdir %USERPROFILE%/whdata
docker run -ti --rm --name webhare -p 80:80 -p 443:443 -v %USERPROFILE%/whdata:/opt/whdata webhare/webhare-core:master

If Docker asks you whether you want to share your C: drive, you should probably do so.

On macOS or Linux

Run the following commands:

mkdir ~/whdata
docker run -ti --rm --name webhare -p 80:80 -p 443:443 -v ~/whdata:/opt/whdata webhare/webhare-core:master

You’ll see something similar to the following screen if WebHare started correctly:

WebHare ships with a CLI tool to control it named ‘wh’. We can use docker to invoke this tool for us. One use is to check WebHare’s status. Let’s see if everything is working correctly:

docker exec webhare wh check

You will see something like:

It’s running, but we cannot connect to it yet . We need to be able to access what we often simply call the ‘backend’ - the WebHare backend interface.

Setting up the Webhare backend interface

On a production server we would generally setup a proxy server to host the interface, but here we’ll let the built-in webserver handle it by itself. We need an open port for virtual hosting so we can run multiple websites on the same port (in our case: the WebHare backend and a future output website).

Nonstandard port numbers

We strongly recommend using the standard port 80/443 for your WebHare installation and using virtual hosting - some features may be more difficult to setup or have subtle issues with non standard port numbers. You will need to modify the docker command line used during installation to open up other ports than 80 and 443.

To create a virtual hosted port on port 80 and host a site named ‘localhost’ on it:

docker exec webhare wh webserver addport --virtual 80
docker exec webhare wh webserver addbackend http://localhost/

When you finish the installation wizard, you will need to actually login with the specified credentials.

Setting up output

To configure output please consult our Webservers setup manual

TODO!