cd /data
mkdir nginx
cd /data/nginx
tar -xzvf nginx-1.20.2.tar.gz
cd nginx-1.20.2
./configure --prefix=/data/nginx
tar -zxvf pcre-8.40.tar.gz
cd /data/pcre/pcre-8.40
./configure
make & make install
./configure --prefix=/data/nginx --with-pcre=data/pcre/pcre-8.40
make && make install
./nginx -t
nginx: the configuration file /data/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /data/nginx/conf/nginx.conf test is successful
这个代表是语法没有问题
cd /data/nginx/sbin/
./nginx -c /data/nginx/conf/nginx.conf
./nginx -c /data/nginx/conf/nginx.conf -s stop
./nginx -c /data/nginx/conf/nginx.conf -s reload
---验证是否安装成功,如下图,即可表示安装成功。
---查询进程
ps -ef|grep ngin
nginx: master process ./nginx -c /data/nginx/conf/nginx.conf
nginx: worker process
curl http://127.0.0.1:19088/