Install Nginx on centOS 6.5

 Preparation before installation

 

yum install gcc-c++

yum install -y pcre pcre-devel

yum install -y zlib zlib-devel

yum install -y openssl openssl-devel
 

 

   Download nginx and unzip it

    Download address: https://nginx.org/download/nginx-1.10.2.tar.gz

 

  1. tar -zxvf nginx-1.10.2.tar.gz

  

   Use default configuration

cd /nginx-1.10.2
./configure

 

    Compile and install

    

make
make install

   

    Find the installation location

     

whereis nginx

 

    Start and stop nginx

     

cd /usr/local/nginx/sbin/
./nginx
./nginx -s stop
./nginx -s quit
./nginx -s reload

./nginx -s quit: The stopping step of this method is to stop the nginx process after the processing task is completed.
./nginx -s stop: This method is equivalent to first finding out the nginx process id and then using the kill command to forcibly kill the process.

 

 

Set up to start automatically
vi /etc/rc.local
add a line
/usr/local/nginx/sbin/nginx
chmod 755 rc.local

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326591767&siteId=291194637