Installing OpenResty
OpenResty is packaged for the easy installation of most Linux distributions, but there are binary packages for both Windows and OS X available as well. As most production deployments will predominantly be Linux-based, we'll concentrate on Linux for our recipe.
Getting ready
If you have NGINX already installed, you'll need to uninstall it first to remove any other conflicts.
How to do it...
Official repositories exist for most major Linux installations, but we'll focus on just CentOS 7 and Ubuntu 16.04 LTS to cover the two most common scenarios.
CentOS
To add the repository, the first thing we need is the yum-utils
package. This makes the creation of repositories as simple as a one-line installation:
yum install -y yum-utils
With yum-utils
installed, we can now create the openresty
repository on our server:
yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo
This will automatically fetch the remote repository file and place it in the correct location...