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/
(2) Unzip pcre
tar -xvf pcre-8.37.tar.gz
(3) Install pcre
cd pcre-8.37/
./configure
Install pcre
make && make install
View version
pcre-config --version
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
make && make install
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
Qigong Nginx, test
cd /usr/local/nginx/sbin
./nginx
ps -ef | grep nginx
Run successfully
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