Home>Article>Operation and Maintenance> How to install nginx on linux server

How to install nginx on linux server

王林
王林 Original
2020-02-14 13:43:49 4042browse

How to install nginx on linux server

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

Unzip and enter the nginx directory

tar -zxvf nginx-1.14.0.tar.gz cd nginx-1.14.0

Use the default configuration of nginx

./configure

Compile and install

make make install

Find the installation path:

whereis nginx

How to install nginx on linux server

Enter the sbin directory, You can see that there is an executable file nginx. Just execute ./ and it will be OK.

After running, access the server IP and you can see the nginx welcome page.

How to install nginx on linux server

How to install nginx on linux server

Recommended related articles and tutorials:

linux tutorial

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn