(1) Download and install the dependency packages

Download nginx – and – GCC. Tar. Gz, click on the download, the compressed package contains nginx – 1.18.0 and nginx need rely on libraries. The dependent libraries are as follows:

  • GCC compiler for Nginx;

  • Future use of C++ to write Nginx G++ compiler;

  • Perl regular expressions (Nginx HTTP module dependency library);

  • Zlib (Network packet Gzip Compression dependency library);

  • Openssl (HTTPS and encryption algorithms such as MD5 and SHA1).

Gz: tar -zxvf gcc.tar.gz

RPM file directory (root permission) and run sudo RPM -uvh *. RPM –nodeps — force to install the. RPM file.

XXX is not in the sudoers file. In this case, you must switch to the root account and run the preceding command.

Verify that the installation is successful: GCC -v

g++ -v

Seeing the GCC version and the g++ version number indicates that we have GCC and gcc-c ++ installed in an offline environment.

Install Nginx

Decompress Nginx: tar -zxvf nginx-1.18.0.tar.gz

Then install 1 by compilation.


./configure

make

make install

Copy the code

On virtual machines, the make command sometimes ends by typing Enter.

Finally verify whether the installation is successful:

/usr/local/nginx/sbin/nginx -v


[1] Describe how to install Nginx in Linux.