1. Preparation

(1) Start the VM and use a remote connection tool to connect to the Linux OPERATING system. (2) Download nginx.org/ from the nginx official website

2. Start nginx installation

(1) Install pcRE dependencies first step Internet download PCRE compressed file dependencies

Wget downloads.sourceforge.net/project/pcr… Step 2 Unzip the compressed file

Using the command

Tar - XVF pcre 8.37. Tar. GzCopy the code

Step 3./configure, go back to the pcre directory and run make, and finally run make install

(2) Install openSSL, zlib and GCC dependencies

yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
Copy the code

Install nginx

  • Decompress using commands (ditto pore)
  • ./configure
  • make && make install

Enter the directory/usr/local/nginx/sbin/nginx start the service

If you want to access nginx in Windows, you cannot access it by default because of firewall problems

(2) Open access port number, port 80

View open port numbers

firewall-cmd --list-all
Copy the code

Set an open port number

firewall-cmd --add-service=http --permanent

firewall-cmd --add-port=80/tcp --permanent
Copy the code

Restarting the Firewall

firewall-cmd --reload
Copy the code