Last Updated: May 2020
The purpose of this section of the guide is to provide background information on important aspects of the production installation of Tethys Portal. Every production installation is different due to the different requirements imposed by the apps that are installed. This section will help you to learn about the different components and how they work together.
It is also important to understand that this guide provides instructions only for the minimal installation and configuration that is required and most installations will require modification. Taking time upfront to understand the different components, why they are needed, and where the important files are stored will save you time when you are debugging issues with the installation later on.
System requirements for your Tethys Portal will largely depend on the apps that are installed on the server and the software dependencies of the apps (PostGIS database, GeoServer, etc.) We recommend the following minimum requirements for a single-server setup with Tethys Portal and PostgreSQL database installed.
Processor: 4 CPU Cores @ 2 GHz+ each
RAM: 4 GB
Hard Disk: 100 GB
This guide provides instructions for installing Tethys Portal for production on an Ubuntu 20.04 and CentOS 8 server.
Tethys Portal is a Django web application with the Django Channels app installed, which makes it an Asynchronous Server Gateway Interface (ASGI) application. As such, it requires an ASGI server to host it.
In this guide you will host Tethys Portal using the Daphne ASGI server with NGINX acting as the primary HTTP server (see: Example Setups). All incoming HTTP traffic will be handled by NGINX which will route most of it to Daphne. Daphne in turn will be hosting the Tethys Portal. The response will be returned up the chain through Daphne to NGINX and back to the client. The NGINX server will handle requests for static files directly for efficiency.
Daphne can and should be configured to run multiple processes. The default configuration will create 4 Daphne processes for example. To make managing the Daphne processes and NGINX process more manageable, Supervisor will be used to allow all five processes to be started, stopped, and restarted with a single command.
A high-performance HTTP server and reverse proxy. It is know for it's rich feature set and simple configuration. NGINX is used in the Tethys Portal production installation as the primary HTTP server. It serves the static files directly and routes other traffic to the Daphne server.
An ASGI server for hosting Django Channels web applications, of which Tethys Portal is one. Daphne is used in the Tethys Portal production installation to host Tethys Portal, which is an ASGI application.
An orchestrator or process control system. It is used in the Tethys Portal production installation to more easily manage the NGINX and Daphne server processes.
The files for a production Tethys Portal are stored in several different locations on the file system. The following general guidelines may help:
Configuration files are stored in
TETHYS_HOMEand linked to
Static Files and Data Files are stored in
Logs are located in the
All configuration files are stored in
TETHYS_HOME. The default location of
~/.tethys. Files that will be located here include:
The NGINX and Supervisor configuration files are symbolically linked to the appropriate location in
/etc (see: System Configuration).
There is no
daphne.conf. The Daphne configuration is contained in the
asgi_supervisord.conf file in the from of arguments to the
Most system configuration files are located in
/etc including the configuration files for NGINX and Supervisor. The NGINX and Supervisor files in
TETHYS_HOME are symbolically linked to these locations:
TETHYS_WORKSPACES_ROOT directories, respectively. The recommend locations for these directories are:
/var/www is usually the home directory of the
Logs for all of the various applications, including Tethys, can be found in
/var/log. The following logs are those that you will likely be most interested in:
The data files and configuration files for a system-installed PostgreSQL are located in the same directory: