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

How to start nginx after installing nginx

(*-*)浩
Release: 2019-11-01 14:55:45
Original
4903 people have browsed it

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
Copy after login

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
Copy after login

Create a new directory:

    sudo mkdir  /usr/local/nginx
Copy after login

Move ngnix to the new directory:

    sudo mv nginx-1.13.3.tar.gz /usr/local/ngnix/
Copy after login

Go to the newly created directory and decompress:

    cd /usr/local/nginx
    sudo tar -zxvf nginx-1.13.3.tar.gz
Copy after login

Go to the nginx-1.13.3 directory and install it:

    ./configure --prefix=/usr/local/nginx
    ## 安装到/usr/local/nginx的nginx目录下
    make
    make install
Copy after login

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
Copy after login

Success is as shown below:

How to start nginx after installing nginx

b. Restart:

    sudo /usr/local/nginx/sbin/nginx -s reload
Copy after login

c. Pause:

    sudo /usr/local/nginx/sbin/nginx -s stop
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template