Skip to Content
NGINX Unit Cookbook
book

NGINX Unit Cookbook

by Derek DeJonghe
July 2019
Intermediate to advanced
50 pages
44m
English
O'Reilly Media, Inc.
Content preview from NGINX Unit Cookbook

Chapter 2. Installation

Introduction

The first step toward 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, and CentOS 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.

Red Hat–Based Systems (.rpm)

Problem

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

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 or centos, depending on your distribution.

Install the Unit base package:

sudo yum install unit

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

sudo yum install unit-php unit-python unit-go unit-perl \
      unit-devel unit-jsc-common unit-jsc8 unit-jsc11

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 that follows installs Unit from the Official repository, as well as the Unit modules needed for each application language you may want to run.

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 Unit Cookbook

NGINX Unit Cookbook

Derek DeJonghe
Nginx Troubleshooting

Nginx Troubleshooting

Alexey Kapranov
Spring 5.0 Cookbook

Spring 5.0 Cookbook

Sherwin John C. Tragura

Publisher Resources

ISBN: 9781492054313