Linux centos7 installation of the latest official stable detailed tutorial of nginx-1.22.0

Songzixian blog 2022-06-23 15:16:40 阅读数:438

linuxcentos7centosinstallationlatest

1. install gcc

install gcc gcc-c++( Nu Skin environment , Not installed, please install )

yum install -y gcc gcc-c++

2. install wget

install wget

yum -y install wget

3 install PCRE library

Get into /usr/local Catalog

cd /usr/local

download PCRE library

wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.33/pcre-8.33.tar.gz

decompression

tar -zxvf pcre-8.33.tar.gz

Get into cd pcre-8.33

cd pcre-8.33

Installation configuration

./configure

Compilation and installation

make && make install

4. install SSL library

yum install -y openssl openssl-devel

5. install zlib stock

Get into /usr/local/

 cd /usr/local/

download

http://zlib.net/zlib-1.2.12.tar.gz

decompression

tar -zxvf zlib-1.2.12.tar.gz

Get into zlib-1.2.11

 cd zlib-1.2.11

To configure

 ./configure

compile

make && make install

6 install nginx

Get into

 cd /usr/local/

download nginx

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

decompression

tar -zxvf nginx-1.22.0.tar.gz

Get into nginx Catalog

 cd nginx-1.22.0

### Choose one of the following two compilation methods

compile ( belt ssl certificate , recommend )

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

compile ( No ssl certificate , Not recommended )

./configure

compile

make && make install

start-up nginx

/usr/local/nginx/sbin/nginx

see nginx process

ps -aux | grep 'nginx'

Turn off firewall

systemctl stop firewalld

stop it nginx

/usr/local/nginx/sbin/nginx -s stop

restart nginx

/usr/local/nginx/sbin/nginx -s reopen
版权声明:本文为[Songzixian blog]所创,转载请带上原文链接,感谢。 https://qdmana.com/2022/174/202206231426267677.html