Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install nginx offline by centos

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report