❗Caution: The scripts included in this article are intended for reference only. You must review, test, and verify that these scripts comply with your internal security and production standards prior to use in a live environment.
Overview
This article describes how to install Exago .NET 4.8 on Red Hat Enterprise Linux 9. The installation script sets up nginx, Mono, and XSP, then installs the Exago WebApp, WebAPI, and Scheduler. It also configures SELinux, firewall access, and the nginx service.
Prerequisites
Confirm each item before starting:
- [ ] RHEL 9 server is provisioned
- [ ] Root or sudo access is available
- [ ]
install_exago_rhel.shis created on the target server from the script in the Script section of this article - [ ] A URL for the Exago installer archive is available, such as an S3 pre-signed URL from Exago Support or a link from the download page
- [ ] Firewall access for HTTP is approved
- [ ] Database connectivity required by Exago is available from the server
Installation Steps
- Create
install_exago_rhel.shon the RHEL 9 server from the script in the Script section of this article. -
Make the script executable:
chmod +x install_exago_rhel.sh
-
Run the script with the URL for the Exago installer archive. Enclose the URL in single quotes:
sudo ./install_exago_rhel.sh '<URL of the Exago installer>'
- Wait for the script to finish. It prints a completion message with SELinux troubleshooting steps. Keep this output in case you need it.
You can run the script again, for example, to upgrade Exago.
What the Script Does
The script runs these stages in order:
- Repositories: Installs EPEL, attempts to enable CodeReady Builder, and runs a full package update.
-
Packages: Installs nginx, the build toolchain, Mono (
mono-complete), and SELinux policy utilities. -
Compiler shim: Creates
/usr/bin/dmcsas a wrapper formcsifdmcsis not present. XSP's build expects this command. -
XSP: Clones the XSP source from GitHub, then runs
autogen.sh,make, andmake installwith the prefix/usr. -
Exago: Downloads the installer archive from the URL, extracts it, and runs
installExago.shfor the WebApp, WebAPI, and Scheduler under/opt/Exago, using nginx. -
SELinux: Sets the
httpd_execmemandhttpd_can_network_connectbooleans, applies thehttpd_sys_rw_content_tlabel to/opt/Exago, and restores contexts. SELinux stays in enforcing mode. - Firewall: Opens the HTTP service in firewalld if the service is running.
- Start: Validates the nginx configuration, enables nginx at boot, and restarts it.
For details about the installExago.sh options, see Installing Exago on Linux.
Script
❗ Caution: This is an example script. Modify it to meet your needs and test it thoroughly in your QA environment. Each environment has its own dependencies for building mod_mono from Git.
#!/usr/bin/env bash
# Install Exago (WebApp, WebAPI, Scheduler) on RHEL 9 with Mono + XSP under nginx.
# Usage: sudo ./install_exago.sh '<Exago installer URL>'
set -euo pipefail
INSTALLER_URL="${1:?Usage: $0 '<Exago installer URL>'}"
EXAGO_DIR=/opt/Exago
SRC_DIR=/usr/local/src
log() { printf '\n==> %s\n' "$*"; }
[[ $EUID -eq 0 ]] || { echo "Run as root." >&2; exit 1; }
# --- Repositories ------------------------------------------------------------
log "Enabling EPEL"
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
# Some EPEL packages depend on CodeReady Builder; non-fatal on RHUI/cloud images.
subscription-manager repos --enable "codeready-builder-for-rhel-9-$(arch)-rpms" \
|| echo "WARN: could not enable CRB via subscription-manager; continuing."
dnf update -y
# --- Packages ----------------------------------------------------------------
log "Installing packages"
dnf install -y \
nginx \
gcc gcc-c++ make autoconf automake libtool pkgconf-pkg-config \
git wget tar gnupg2 sudo vim \
giflib mono-complete \
policycoreutils-python-utils
dnf clean all
# XSP's build still looks for the legacy dmcs compiler.
if [[ ! -e /usr/bin/dmcs ]]; then
cat > /usr/bin/dmcs <<'EOF'
#!/bin/sh
exec /usr/bin/mcs "$@"
EOF
chmod 755 /usr/bin/dmcs
fi
# --- Build XSP ---------------------------------------------------------------
build_from_git() {
local repo=$1 dir=$2; shift 2
[[ -d $dir ]] || git clone --depth 1 "$repo" "$dir"
( cd "$dir" && ./autogen.sh "$@" && make -j"$(nproc)" && make install )
}
mkdir -p "$SRC_DIR"
log "Building XSP"
build_from_git https://github.com/mono/xsp.git "$SRC_DIR/xsp" --prefix=/usr
# --- Exago -------------------------------------------------------------------
log "Downloading and installing Exago"
cd "$SRC_DIR"
wget -O ExagoInstaller.tgz "$INSTALLER_URL"
tar xzf ExagoInstaller.tgz
( cd Installer && ./installExago.sh -d "$EXAGO_DIR" -w NGINX -m TRUE -i WEBAPP -i WEBAPI -i SCHEDULER -y )
# --- SELinux (stays enforcing) -----------------------------------------------
log "Configuring SELinux"
setsebool -P httpd_execmem 1 # Mono JIT needs executable memory
setsebool -P httpd_can_network_connect 1 # Exago -> remote databases
semanage fcontext -a -t httpd_sys_rw_content_t "${EXAGO_DIR}(/.*)?" 2>/dev/null \
|| semanage fcontext -m -t httpd_sys_rw_content_t "${EXAGO_DIR}(/.*)?"
restorecon -R "$EXAGO_DIR"
# --- Firewall (only if firewalld is running) ---------------------------------
if systemctl is-active --quiet firewalld; then
firewall-cmd --permanent --add-service=http
firewall-cmd --reload
fi
# --- Start -------------------------------------------------------------------
log "Starting nginx"
nginx -t
systemctl enable nginx
systemctl restart nginx
cat <<'EOF'
Done. If Exago still hits SELinux denials:
1. setenforce 0, then exercise the app (log in, run a report, trigger the scheduler)
2. ausearch -m avc -ts recent | audit2allow -M exago_mono
3. Review exago_mono.te, then: semodule -i exago_mono.pp
4. setenforce 1 && systemctl restart nginx
EOFValidation
Complete each check after installation and record the result.
| Check | Command or action | Expected result | Status |
|---|---|---|---|
| nginx service | systemctl status nginx |
nginx is active and enabled |
VERIFY |
| nginx configuration | nginx -t |
Configuration test is successful | VERIFY |
| Mono runtime | mono --version |
Mono returns version information | VERIFY |
| Exago files | ls -la /opt/Exago |
WebApp, WebAPI, and Scheduler files are present | VERIFY |
| SELinux context | ls -Zd /opt/Exago |
Exago files are labeled httpd_sys_rw_content_t for nginx and HTTP service access |
VERIFY |
| Application access | Open the server URL in a browser. For the URL path, see Installing Exago on Linux. | Exago login or admin page loads | VERIFY |
| Scheduler | Trigger or observe a scheduled job. For the Scheduler service name, see Installing Exago on Linux. | Scheduler runs without SELinux or connectivity errors | VERIFY |
For log locations, see Installing Exago on Linux.
Troubleshooting SELinux Denials
If Exago fails with permission errors, follow these steps:
- Temporarily switch SELinux to permissive mode:
setenforce 0. Permissive mode lowers protection, so complete the remaining steps promptly and return to enforcing mode. - Use the application: log in, run a report, and trigger the scheduler.
-
Generate a policy module from the recent denials:
ausearch -m avc -ts recent | audit2allow -M exago_mono
- Review
exago_mono.tebefore installing it. Do not install a module you have not reviewed. - Install the module:
semodule -i exago_mono.pp. - Return SELinux to enforcing mode and restart nginx:
setenforce 1 && systemctl restart nginx.