Centos7.3 How to install and deploy Nginx and configure https

Centos7.3 How to install and deploy Nginx and configure https

Installation Environment

1. gcc installation

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

Compilation depends on the gcc environment:

yum install gcc-c++

2. PCRE pcre-devel installation

Install pcre-devel, which is a secondary development library developed using pcre. :

yum install -y pcre pcre-devel

3. zlib Installation

The zlib library provides many ways of compression and decompression. Nginx can use zlib to gzip the contents of http packets:

yum install -y zlib zlib-devel

4. OpenSSL Installation

A powerful secure socket layer cryptographic library that includes major cryptographic algorithms, commonly used key and certificate package management functions, and SSL protocols. Nginx needs to support https (transmit http over ssl protocol)

yum install -y openssl openssl-devel

Install Nginx

Download using wget command

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

Unzip

tar -zxvf nginx-1.9.9.tar.gz
cd nginx-1.9.9/

Configuration

Common configuration

#./configure

Configure https:

./configure --with-http_ssl_module

Install

make
make 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

Notes:

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

./nginx -s quit: This method stops the nginx process after it has completed its processing tasks.

./nginx -s stop: This method is equivalent to first finding out the nginx process ID and then using the kill command to forcibly kill the process.

To configure SSL, please check which server you are using and apply for an SSL certificate when applying for a domain name, and then configure it directly in the server load balancing.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed process of configuring Https certificate under Nginx
  • Nginx configures the same domain name to support both http and https access
  • Detailed configuration of Nginx supporting both Http and Https
  • Nginx domain name SSL certificate configuration (website http upgraded to https)
  • How to configure SSL certificate in nginx to implement https service
  • Detailed explanation of Frp forced redirection to https configuration under Nginx
  • How to install nginx in docker and configure access via https
  • Detailed explanation of nginx using ssl module configuration to support HTTPS access
  • Nginx implements https website configuration code example

<<:  The role of MySQL 8's new feature window functions

>>:  js implements a simple shopping cart module

Recommend

The benefits and examples of placing the site map at the bottom of the web page

In the past, almost every website had a sitemap p...

MySQL database table partitioning considerations [recommended]

Table partitioning is different from database par...

About IE8 compatibility: Explanation of the X-UA-Compatible attribute

Problem description: Copy code The code is as fol...

Study notes to write the first program of Vue

Table of contents 1. Write an HTML, the first Vue...

Install Python virtual environment in Ubuntu 18.04

For reference only for Python developers using Ub...

A brief discussion on what situations in MySQL will cause index failure

Here are some tips from training institutions and...

vue_drf implements SMS verification code

Table of contents 1. Demand 1. Demand 2. SDK para...

Solution to the problem that docker logs cannot be retrieved

When checking the service daily, when I went to l...

Interpretation of 17 advertising effectiveness measures

1. 85% of ads go unread <br />Interpretatio...

How to completely uninstall mysql under CentOS

This article records the complete uninstallation ...

Detailed explanation of the use of title tags and paragraph tags in XHTML

XHTML Headings Overview When we write Word docume...

JavaScript Dom implements the principle and example of carousel

If we want to make a carousel, we must first unde...

HTML+VUE paging to achieve cool IoT large screen function

Effect demo.html <html> <head> <me...

Detailed troubleshooting of docker.service startup errors

Execute the following command to report an error ...