Home >Operation and Maintenance >Nginx >How to start nginx after installing nginx
Installation (Recommended learning: nginx tutorial)
Before installing nginx, first ensure that the system has installed dependencies: g, gcc, openssl-devel, pcre-devel and zlib-devel software
yum install gcc-c++ yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel
First, download the required version: http://nginx.org/en/download.html
Then go to the linux terminal and execute: (the link address you copied)
sudo wget http://nginx.org/download/nginx-1.13.3.tar.gz
Create a new directory:
sudo mkdir /usr/local/nginx
Move ngnix to the new directory:
sudo mv nginx-1.13.3.tar.gz /usr/local/ngnix/
Go to the newly created directory and decompress:
cd /usr/local/nginx sudo tar -zxvf nginx-1.13.3.tar.gz
Go to the nginx-1.13.3 directory and install it:
./configure --prefix=/usr/local/nginx ## 安装到/usr/local/nginx的nginx目录下 make make install
After the execution is completed, go to the newly created folder , there will be conf, hmtl, sbin and other folders:
2. Start, restart, pause
a. Start execution :
sudo /usr/local/nginx/sbin/nginx
Success is as shown below:
b. Restart:
sudo /usr/local/nginx/sbin/nginx -s reload
c. Pause:
sudo /usr/local/nginx/sbin/nginx -s stop
The above is the detailed content of How to start nginx after installing nginx. For more information, please follow other related articles on the PHP Chinese website!