-
Notifications
You must be signed in to change notification settings - Fork 0
XNAT Installation Overview
The xnat-setup repo contains seperate folders for each container. in addition:
- /path/to/xnat-setup/Linux: This contains all the maintenance scripts. For example, build.sh, restart.sh, update_xnar_war.sh
- /path/to/xnat-setup/[nginx/postgres/xnat]: These are the files used to construct the docker images.
- /path/to/xnat-setup/plugins: This contains all the XNAT plugins. Some, listed in xnat.cfg, are automatically downloaded and installed during the build process or when restarting. Other plugins can be manually placed in the folder before building or restarting.
- /path/to/xnat-setup/certs: place all your SSL certificates here before building.
- /path/to/xnat-setup/scripts: This cotnains all the scripts that run within the XNAT docker container. In addition there's optional cronjobs that can be run on the host server.
When XNAT is built, it creates a directory /xnat-data which contains all the container mount points - including the database and archive.
XNAT is a Java web application, written in Java. Apache Tomcat is an open-source server for dynamic Java web applications. XNAT relies on Java, Apache Tomcat 9, Postgresql and Nginx.
Using this xnat-setup script, XNAT is deployed as a docker stack. 3 docker containers run together in a network. The three base images are:
-
Tomcat/JDK - Tomcat version 9 / JDK 21 - Docker image: tomcat:9.0.115-jdk21-temurin-noble
-
Postgresql - Version: 16 - Docker image: postgres:16
During the build process, the latest versions of these images are pulled from https://hub.docker.com/ and new Docker images are created and run as docker containers as part of a docker stack. During the build process, a file docker-compose.yml is created that contains the resources and information regarding the 3 containers that run based on the images created.
During the build process, XNAT is downloaded as a .war file, for example xnat.war. This is a compressed file containing the web application. This is placed in the folder inside of the tomcat:
/usr/local/tomcat/webapps/ROOT
This is the location inside the Tomcat Docker container filesystem, and not on the host filesystem.
Postgresql:
Postgresql is the database backend of XNAT. It stores all the data for XNAT. The database name is xnat.
Nginx:
Nginx is a server used as a front-end proxy - it manages the SSL certificates and routes traffic towards the Tomcat web server, which hosts XNAT.
UFW / iptables:
Iptables is the Linux firewall software. iptables can be tricky to configure. UFW (Uncomplicated Firewall) is a tool to ease the configuration of iptables. An example of a UFW command:
ufw allow https
This is DISABLED by default. If running inside Docker, install UFW on your host computer and configure the firewall.
File system:
As these are virtual machines, their filesystems are also virtual. Certain directories are mapped to the host server. All the mount directories are contained within /xnat-data. This is configured within the xnat.cfg file. Highly recommend to stay with the default at present.
Postgresql:
/xnat-data/postgresql/ - this is the postgresql database
Nginx:
/xnat-data/xnat
./certificates - this contains the SSL certificates and is on the NGinx container (/etc/ssl)
./nginx_logs - the log files pertaining to the Ngnix container (var/log/nginx/
Tomcat:
/xnat-data/xnat
./archive
./build
./tomcat_logs
./scripts
./inbox
/xnat-data/import_data - place directories of sessions here and they are automatically imported into XNAT.
Log File:
The tomcat XNAT logfiles are located:
/data/xnat/home/logs/
This is the location inside the container if running within Docker. This is mapped, by default to:
/xnat-data/xnat/tomcat_logs/
Additional set-up log files are located in:
/xnat-data/xnat/scripts/logs/
Next step: UFW, Ports and Firewall Configuration