Home  >  Article  >  Operation and Maintenance  >  How to start nginx after installing nginx

How to start nginx after installing nginx

(*-*)浩
(*-*)浩Original
2019-11-01 14:55:454642browse

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

How to start nginx after installing nginx

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:

How to start nginx after installing nginx

2. Start, restart, pause

a. Start execution :

    sudo /usr/local/nginx/sbin/nginx

Success is as shown below:

How to start nginx after installing nginx

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn