Get the App
SLTechnology News&Howtos  ›  Servers  › 

Centos7.3 methods and steps for installing and deploying Nginx and configuring https

Shulou Source: shulou.com Published: 2022-06-02 04:15:56 10月02日 Update

Installation environment

1. Gcc installation

To install nginx, you need to compile the source code downloaded from the official website.

Compilation depends on the gcc environment:

Yum install gcc-c++

2. PCRE pcre-devel installation

Installing pcre-devel is a secondary development library developed using pcre. :

Yum install-y pcre pcre-devel

3. Zlib installation

The zlib library provides many ways to compress and decompress, and nginx can use zlib to gzip the contents of the http package:

Yum install-y zlib zlib-devel

4. OpenSSL installation

A powerful secure socket layer password library, with main cryptographic algorithms, commonly used key and certificate encapsulation management functions and SSL protocol. Nginx is required to support https (http over ssl protocol)

Yum install-y openssl openssl-devel

Install Nginx

Download using the wget command

Wget-c https://nginx.org/download/nginx-1.9.9.tar.gz

Decompression

Tar-zxvf nginx-1.9.9.tar.gzcd nginx-1.9.9/

Configuration

General configuration

#. / configure

Configure https:

. / configure-- with-http_ssl_module

Installation

Makemake install

Find the installation path:

Whereis nginx

Start and stop nginx

Cd / usr/local/nginx/sbin/./nginx./nginx-s stop./nginx-s quit./nginx-s reload

Note:

. / nginx-t: check whether the nginx.conf configuration file is correct

. / nginx-s quit: in this way, the stop step is to stop after the nginx process has finished processing the task.

. / nginx-s stop: this method is equivalent to finding out the nginx process id and then using the kill command to force the killing of the process.

To configure ssl, please check which server you use to apply for a ssl certificate while applying for a domain name, and then configure it directly in the server load balancer.

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

Tags: Configuration mode process content command password server environment certificate development support service compilation step powerful normal balanced security task function Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei vpn Xiaomi Apple MariaDB