Get the App
SLTechnology News&Howtos  ›  Development  › 

How to install nginx offline by centos

Shulou Source: shulou.com Published: 2022-06-01 13:03:26 09月20日 Update

This article is about how centos installs nginx offline. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Installation preparation

The offline installation of Nginx depends on the gcc and GroupPlus environment, so check the following systems to see if they come with gcc and galleys before installation. If not, you need to install them first.

Openssl, pcre and zlib need to be installed before installing Nginx. According to the official website of Nginx, there seems to be no requirement for the version of openssl, but version 8.44 for pcre, version 1.2.11 for zlib, and 1.18.0 for nginx offline installation package.

Import the downloaded nginx_pacakge package into the / usr/local directory

Install gcc

Check to see if gcc is installed on the system

Gcc-v

As shown in the figure, if gcc is already installed in the system environment, you do not need to install it again, ignoring the following steps.

Otherwise, perform the following steps:

Go to the / usr/local/nginx_package/gcc directory and execute the following command to install gcc:

Rpm-ivh * .rpm-nodeps-force

Where-nodeps indicates ignoring dependency checking and-- force indicates mandatory installation.

Install glossy +

Check to see if gcc is installed on the system

Gmail +-v

As shown in the figure, there is no need to install gears installed in the system environment, ignoring the following steps.

Otherwise, perform the following steps:

Go to the / usr/local/nginx_package/g++ directory and execute the following command to install the glossy installation:

Rpm-ivh * .rpm-nodeps-force

Where-nodeps indicates ignoring dependency checking and-- force indicates mandatory installation.

Install openssl

Extract the openssl into the / usr/local/nginx_package directory and execute the following command to extract the openssl:

Tar-zxvf openssl-1.0.2h.tar.gz

Enter the extracted openssl-1.0.2h directory and execute the following command to prepare before compilation:

. / config

Compile and install:

Make & & make install

Install pcre

Extract the pcre into the / usr/local/nginx_package directory and execute the following command to extract the pcre:

Tar-zxvf pcre-8.44.tar.gz

Enter the extracted pcre-8.44 directory and execute the following command to prepare before compilation:

. / configure

Compile and install:

Make & & make install

Install zlib

Extract the zlib into the / usr/local/nginx_package directory and execute the following command to extract the zlib:

Tar-zxvf zlib-1.2.11.tar.gz

Enter the extracted zlib-1.2.11 directory and execute the following command to prepare before compilation:

. / configure

Compile and install:

Make & & make install

Install Nginx

Extract the nginx into the / usr/local/nginx_package directory and execute the following command to extract the nginx:

Tar-zxvf nginx-1.18.0.tar.gz

Enter the extracted nginx-1.18.0 directory, create the nginx directory under / usr/local, and execute the following command to prepare for compilation:

Mkdir / usr/local/nginx./configure-- prefix=/usr/local/nginx-- with-http_ssl_module-- with-pcre=../pcre-8.44-- with-zlib=../zlib-1.2.11-- with-openssl=../openssl-1.0.2h

Compile and install:

Make & & make install

Go to the / usr/local/nginx/sbin directory and verify that the installation is successful:

. / nginx-t

Launch nginx./nginx open port 80 firewall-cmd-zone=public-add-port=80/tcp-permanentfirewall-cmd-reload access test thank you for reading! This is the end of the article on "how to install nginx offline in centos". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Directory command compilation system preparation step version environment check content more articles such as figure mandatory good practical successful article look knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno MariaDB Shulou Technology Huawei Shulou Information