Installing IRIS in RHEL or Rocky Linux 8 & 9 - SRF-Consulting-Group-Inc/iris GitHub Wiki

Background

Related to changes in the release model of CentOS, Red Hat Enterprise Linux (RHEL), Rocky Linux, and CentOS 8 or 9 all require additional steps to install IRIS compared to previous versions or Fedora Linux. This is primarily due to the missing osm2pgsql package, which does not have a pre-built version present in the Extended Packages for Enterprise Linux (EPEL) repository as it did in the CentOS 7 EPEL repo. This may change in the future, but the change to CentOS Stream, creation of Rocky Linux, and role of Red Hat makes the path forward for this very uncertain. Thankfully though it's just one package, so it's easy enough to build it from source and move along.

Prep: Installing PostgreSQL and PostGIS

PostGIS is not included in the standard RHEL/Rocky/CentOS repositories, but PostgreSQL provides a repository for it. It's also advised to use PostgreSQL's repository generally since it provides packages for more recent versions of PostgreSQL.

First, add PostgreSQL's repository. For RHEL/Rocky 8:

sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

For 9:

sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm

Enable the EPEL and PowerTools repositories:

# For all
sudo dnf install dnf-plugins-core

# RHEL 8
sudo subscription-manager repos --enable codeready-builder-for-rhel-8-$(arch)-rpms
sudo dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

# RHEL 9
sudo subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms
sudo dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

# Rocky 8/9
sudo dnf config-manager --set-enabled crb
sudo dnf install epel-release

Disable the default PostgreSQL AppStream repository:

sudo dnf -qy module disable postgresql

Install the latest stable version of PostgreSQL (16 as of the time of writing):

sudo dnf install postgresql16-server

You will also need to initialize the database cluster and enable/start the service:

sudo /usr/pgsql-16/bin/postgresql-16-setup initdb
sudo systemctl enable postgresql-16.service 
sudo systemctl start postgresql-16.service

Finally, install the latest version of PostGIS (3.4 in this case) for the version of PostgreSQL you installed. You will also need the utils package, so install that too.

sudo dnf install postgis34_16 postgis34_16-utils

Installing osm2pgsql

osm2pgsql will have to be installed from source. It is recommended to use the most recent release version, rather than the active version from GitHub, which may not be stable. The latest release version can be found on the GitHub project page, along with detailed build instructions

Download the latest release (1.10.0 as of time of writing) right to the server:

wget -O osm2pgsql-1.10.0.tar.gz https://github.com/osm2pgsql-dev/osm2pgsql/archive/refs/tags/1.10.0.tar.gz

Unpack the archive and enter the project directory:

tar zxf osm2pgsql-1.10.0.tar.gz
cd osm2pgsql-1.10.0/

Install dependencies:

sudo dnf install cmake make gcc-c++ boost-devel expat-devel zlib-devel bzip2-devel postgresql16-devel proj-devel lua-devel pandoc json-devel

Use CMake to build the Makefiles in a new directory:

mkdir build
cd build
cmake ..

Build with make:

make -j $(nproc)

The man page can be built with:

make man

Finally, install with:

sudo make install

Installing IRIS

You can now install IRIS on the server, however because of the "missing" dependency, dnf will complain and not let you do it. To get around this, you will have to use the lower-level rpm tool. rpm will not install other dependencies though, so you will need to install those with dnf manually.

Install the remaining dependencies (note that Java 11, and maybe other versions, should also work on the server side):

sudo dnf install java-1.8.0-openjdk nginx postgresql-jdbc

Run sudo rpm -ivh iris-5.49.0-1.noarch.rpm to check that all dependencies besides osm2pgsql are installed. If they aren't rpm will complain about them. If osm2pgsql is the only one it complains about, then add the --nodeps flag to actually install IRIS:

sudo rpm -ivh --nodeps iris-5.49.0-1.noarch.rpm

Initialize the IRIS server:

sudo iris_ctl init

You can now start IRIS with systemd:

sudo systemctl start iris.service

Editing Firewall Rules for Nginx

RHEL/Rocky will block HTTP by default. To allow HTTP traffic to let users access the IRIS download page, run following commands:

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload

Updating IRIS

Updating IRIS is similar to installing and must be done with rpm. Dependencies aside from osm2pgsql should update automatically with the usual dnf update command. Updating osm2pgsql will require rebuilding new releases from source.

To update IRIS, use the same rpm command, replacing the -i flag with -U:

sudo rpm -Uvh --nodeps iris-<version>.noarch.rpm

And update with iris_ctl:

sudo iris_ctl update
⚠️ **GitHub.com Fallback** ⚠️