Step 1: Install PCRE pcre-devel and Zlib
PCRE (Perl Compatible Regular Expressions) is a Perl library, including perl Compatible regular expression library. The http module of nginx uses pcre to parse regular expressions, so the pcre library needs to be installed on Linux. pcre-devel is a secondary development library developed using pcre. nginx also requires this library. Command:
yum install -y pcre pcre-devel
The zlib library provides many compression and decompression methods. nginx uses zlib to gzip the contents of the http package, so the zlib library needs to be installed on Centos.
yum install -y zlib zlib-devel
After installing these two, you can install nginx, but if there are problems during installation, you may need to install GCC and OpenSSL. The following commands are provided:
yum install gcc-c++ yum install -y openssl openssl-devel
(Free learning video tutorial sharing :linux video tutorial)
Step 2: Install nginx, 1.14.0
##
wget -c https://nginx.org/download/nginx-1.14.0.tar.gz
tar -zxvf nginx-1.14.0.tar.gz cd nginx-1.14.0
./configure
make make install
whereis nginx
The above is the detailed content of How to install nginx on linux server. For more information, please follow other related articles on the PHP Chinese website!