If any step seems confusing or doesn't work right away, check its sub items. Some are for clarification or error handling.
- Recommended OS is Ubuntu focal. Any later Ubuntu LTS should work as well.
- Shell commands in this tutorial assume you use bash as your shell.
- Install:
- git
- Docker CE (Community Edition) → Docker Ubuntu Install Guide
- an apache webserver with
mod_proxy
- optionally, some sort of user login mechanism for Apache.
- How to configure your Apache
- DevDock (a templating system for docker-compose).
- Version 0.2.1 should work. At time of writing (2024-01-09), this is the latest.
- Make sure that the hostname is configured correctly for use as a
FQDN (fully-qualified domain name).
- You can verify this by running
hostname --fqdn
– it should print a name that is registered in global DNS, or at least resolvable by all computers intended to access the anno server. - The FQDN should resolve to a public-facing IP address of the anno server.
- … even when resolving locally
(
gethostip --decimal "$(hostname --fqdn)"
) or you may run into docker troubles when you try to use additional tools like our DOI bot. It's possible to make it work for local IP addresses, but we won't cover that here.
- You can verify this by running
- Open a shell session for user root.
- Create an OS user as which the anno server shall run.
In this tutorial, we'll assume
- user name
annosrv
, - member of a group with the same name,
- home directory is
/srv/annosrv
, - login disabled ⇒ the only way to get a shell as that user is
sudo -su annosrv
or similar.- Do not confuse
sudo
's-su
flags with thesu
command, which would probably fail when login is disabled. Withsudo
,-s
means to start a--shell
, and-u annosrv
means--other-user=annosrv
.
- Do not confuse
- user name
chown --recursive annosrv:annosrv -- /srv/annosrv
- Put the root shell aside, we'll need it again later.
- Start a shell session as user
annosrv
. - … and
cd
to its home directory if you aren't there yet. - Ensure that user
annosrv
has no control over the docker daemon. (Earlier versions of this guide advised the opposite.)- Test access to the docker daemon: Run
docker version
- The expected good response should include the message "ERROR: Got permission denied while trying to connect to the Docker daemon socket".
- If that error message is missing, remove user
annosrv
from all docker-related OS user groups and reboot.
- Test access to the docker daemon: Run
- If you already have a
/srv/annosrv/anno-server-22
from a previous install attempt, move it to some backup directory. The next step (cloning) would fail if the directory already exists. git clone --single-branch --branch stable https://github.com/UB-Heidelberg/anno-server-22
- Verify the cloning:
ls anno-server-22/run_*.sh
— the expected good response isanno-server-22/run_server.sh
.
If you want DOI registration for your annotations, this optional chapter
shows how to install anno-doi-bot-23
.
The anno server works perfectly well even without a DOI bot.
- If you do not need a DOI bot, jump to the next subchapter "Back to root".
- Create a directory for the DOI bot modules.
We'll assume
/srv/annosrv/doibot
. cd /srv/annosrv/doibot
- Clone the main DOI bot repo:
git clone --single-branch --branch stable https://github.com/UB-Heidelberg/anno-doi-bot-23
- If you also want the DataCite registry adapter:
git clone --single-branch --branch stable https://github.com/UB-Heidelberg/anno-doi-bot-23-adapter-datacite
- Pre-emptive hints for the next step:
- You do not need to
npm install
those repos individually. Skip that step, because the docker install script will do that soon. - You already cloned them, so you can skip their cloning step.
- Don't start the DOI bot or any adapter yet. DevDock will do that later.
- You do not need to
- With those hints in mind, set up each DOI bot component according to its readme (or similar docs), because it may have warnings or instructions not addressed above.
- Put the
annosrv
shell aside for later. Switch back to your root shell. - If you have chosen to do the DOI bot install part above, export an
environment variable
EXTRAS_DIR
that points to where your DOI bot modules are. With the example paths, that would be:export EXTRAS_DIR=/srv/annosrv/doibot
- In that root shell, run:
/srv/annosrv/anno-server-22/util/install_dockerized.sh
- It will create a temporary node.js docker container, mount the
anno-server-22
directory into it, and use npm inside the container to arrange various things. (For details about what and why, seeutil/install_dockerized.md
next to the script.) - If you have set an
EXTRAS_DIR
, the script will also install all Node.js modules that are subdirectories ofEXTRAS_DIR
.
- It will create a temporary node.js docker container, mount the
- You may now close the root shell.
The further configuration should happen as user
annosrv
. (Or you can do them as anyone and laterchown
all files.) - One anno server installation can run several instances,
each with their own docker-internal hostname.
(The docker project will make its own virtual network with locally
assigned hostnames, independent of DNS.)
Choose a hostname for your first instance.
- It should start with a letter and may consist of letters, numbers and hyphens. (No dots. This is not a FQDN.)
- In this example, we will assume that hostname to be
dkas22
. ("dk" = Docker, "as22" = anno-server-22) - You will need this hostname again later.
- Create an anno server instance config.
That's a subdirectory in the
anno-server-22
directory namedcfg.@
+ the instance's hostname.- An example config directory can be found in
../../cfg/ubhd-ex01/.
To use it:
cp -rnT -- docs/cfg/ubhd-ex01/ cfg.@dkas22
- Directory naming explained: "cfg." = config, "@" = host-specific. In the future, there may be others like "cfg.site" and "cfg.vendor".
- An example config directory can be found in
../../cfg/ubhd-ex01/.
To use it:
- You can customize your instance config now or at any time later.
See the example config's
README.md
for how. Most changes will take effect only when you restart the server.- ⚠ Make sure to review the ACL and security settings before you make your anno server accessible to users or the public.
- Now you need to set up docker-compose.
To make that easier, we use the templating system "DevDock".
- The next steps will require basic knowledge of DevDock, at least project/directory names and container control commands. You can find them in the DevDock Readme.
- A good place to put your DevDock project is inside your instance config directory.
- An example config directory can be found in
../../cfg/as22.devdock/.
To use it:
cp -rnt cfg.@dkas22/ -- docs/cfg/as22.devdock
- The anno server software itself is now installed.
- Set up a reverse proxy and ensure some security aspects: see here.
- Prepare the database and start the server:
See the
README.md
of the example DevDock project.