Skip to Content
NGINX Unit Cookbook
book

NGINX Unit Cookbook

by Derek DeJonghe
September 2020
Intermediate to advanced
68 pages
1h 12m
English
O'Reilly Media, Inc.
Content preview from NGINX Unit Cookbook

Chapter 2. Installation

The first step for using NGINX Unit is installing it. NGINX Unit can be installed on a wide variety of systems. This chapter will detail how to install Unit on the major Linux distributions such as Debian, Ubuntu, Red Hat, CentOS, and Amazon Linux through NGINX package repositories. Other installation methods, such as compiling from source and using third-party repositories, are also included to enable success with NGINX Unit on virtually any Linux-based platform.

2.1 Red Hat–Based Systems (.rpm)

Problem

You need to install NGINX Unit on Red Hat, CentOS, or Amazon Linux.

Solution

Create a file named /etc/yum.repos.d/unit.repo that contains the following contents:

[unit]
name=unit repo
baseurl=https://packages.nginx.org/unit/OS/$releasever/$basearch/
gpgcheck=0
enabled=1

Alter the file, replacing OS at the end of the URL with rhel, centos, amzn, or amzn2, depending on your distribution.

Install the Unit base package:

sudo yum install unit

Install additional modules that you may want to use with Unit:

RHEL-like systems version 6.x:

sudo yum install unit-devel unit-jsc8 unit-php unit-python

For RHEL-like systems version 7.x and 8.x, you must specify versions of some language modules:

sudo yum install unit-devel unit-jsc8 unit-jsc11 \
      unit-perl unit-php unit-python27 unit-python36

Discussion

The file you just created for this solution instructs the yum package management system to utilize the Official NGINX Unit package repository. The command ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Nginx Troubleshooting

Nginx Troubleshooting

Alexey Kapranov
DB2® SQL PL: Essential Guide for DB2® UDB on Linux™, UNIX®, Windows®, i5/OS™, and z/OS®, Second Edition

DB2® SQL PL: Essential Guide for DB2® UDB on Linux™, UNIX®, Windows®, i5/OS™, and z/OS®, Second Edition

Zamil Janmohamed, Clara Liu, Drew Bradstock, Raul Chong, Michael Gao, Fraser McArthur, Paul Yip
Web Site Cookbook

Web Site Cookbook

Doug Addison

Publisher Resources

ISBN: 9781492078555Errata Page