Install Ngnix

Install N gnix Install Ngnix An installed N G n- I X

1.1 Install basic dependencies

Install openssl, zlib, gcc and other dependencies

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

1.2 Installation depends on pcre

(1) Download pcre

wget http://downloads.sourceforge.net/project/pcre/pcre/8.37/pcre-8.37.tar.gz 
mv pcre-8.37.tar.gz /usr/src/

Insert picture description here

(2) Unzip pcre

tar -xvf pcre-8.37.tar.gz 

Insert picture description here

(3) Install pcre

cd pcre-8.37/
./configure

Insert picture description here

Install pcre

make && make install

Insert picture description here

View version

pcre-config --version

Insert picture description here

Install Ngnix

mv nginx-1.12.2.tar.gz /usr/src/
 tar -xvf nginx-1.12.2.tar.gz 
cd nginx-1.12.2/
./configure 

Insert picture description here

make && make install

Insert picture description here
After the installation is successful, a /usr/local/nginx folder will be created, there is a sbin file shelf in nginx, and there is a startup script inside
Insert picture description here

Qigong Nginx, test

cd /usr/local/nginx/sbin
./nginx
ps -ef | grep nginx

Insert picture description here

Run successfully

Insert picture description here

Supplement: Ngnix commonly used commands

cd /usr/local/nginx/sbin

1. Check the version number

./nginx -v

2.Qigong Nginx

./nginx

3. Stop Nginx

./nginx -s stop

4. Reload Nginx

./nginx -s reload

Guess you like

Origin blog.csdn.net/qq_41375318/article/details/115031433