Centos8-install Nginx

Various versions

  • nginx :
    nginx-1.18.0.tar.gz

wget http://nginx.org/download/nginx-1.18.0.tar.gz

  • openssl:
    Insert picture description here

nginx installation

Create installation package file

mkdir nginxTools

Download the nginx installation source file

cd /root/nginxTools
wget http://nginx.org/download/nginx-1.18.0.tar.gz

Unzip the source file

Unzip the nginx-1.18 file to the /usr/local/nginxfile path:

tar zxf nginx-1.18.0.tar.gz -C /usr/local/src/

Configuration compilation

Enter the decompressed source code path:

cd /usr/local/src/

Run the configuration script:

./configure --prefix=/usr/local/nginx  
--with-http_ssl_module 
--with-http_stub_status_module 
--with-http_gzip_static_module --with-pcre

Compile and install

make

make install

run

Enter the compiled and installed nginx directory:

cd /usr/local/nginx/sbin

./nginx

access

Listen on port 80 by default, of course it can be configured

Server ip: 80

After accessing the link, the following appears, indicating that the installation is successful.
Insert picture description here

View nginx version

cd /usr/local/nginx/sbin/
Insert picture description here

./nginx -v
Insert picture description here

problem

OpenSsl Gcc installation problem

yum -y install gcc gcc-c++ autoconf automake make

Specify version yum problem

Of course, use the yumcommand and install by default 最新版. The need to ensure nginx版本and gccas well as opensslversions fit!

Use to yumview the software version information that can be installed:

yum list | grep xxxx

Then use the following command to download and install the specified version:

yum install xxxx

This reference material: Use yum to install the specified version of the software in the CentOS system

Compilation issues

  • checking for PCRE library… not found
    missing pcrerelated library files

yum install pcre-devel

Reference

Centos7 install Nginx1.11.3
centos7 compile nginx, use openssl1.1.1h version

Guess you like

Origin blog.csdn.net/qq_38322527/article/details/115214320