How to install nginx on linux server

王林
Release: 2020-02-14 13:43:49
Original
4129 people have browsed it

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
Copy after login

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
Copy after login

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
Copy after login

(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
Copy after login

Unzip and enter the nginx directory

tar -zxvf nginx-1.14.0.tar.gz
cd nginx-1.14.0
Copy after login

Use the default configuration of nginx

./configure
Copy after login

Compile and install

make
make install
Copy after login

Find the installation path:

whereis nginx
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!