Table of Contents
What is Nginx?
Nginx stop and restart commands
What is a Linux system
Home Operation and Maintenance Nginx How to install, start, restart and stop Nginx under Linux

How to install, start, restart and stop Nginx under Linux

May 19, 2023 pm 01:28 PM
linux nginx

What is Nginx? How to restart/stop Nginx in Linux system? In response to the above problems, the following article will explain to you what Nginx is specifically, as well as the installation/start/restart/stop of Nginx under Linux.

What is Nginx?

Nginx is a lightweight web server/reverse proxy server and email proxy server, and is released under a BSD-like protocol. It was developed by Russian programmer lgor Sysoev and is used by Rambler, a large Russian portal website and search engine. It is characterized by occupying less memory and strong concurrency capability. In fact, nginx's concurrency capability does perform better among web servers of the same type.

Compared with Apache\lighttpd, Nginx has the advantages of less memory and high stability. It is also famous for its strong concurrency capabilities, rich module library and friendly and flexible configuration.

Under the Linux operating system, nginx uses the epoll event model. Thanks to this, nginx is quite efficient under the Linux operating system. . At the same time, Nginx uses an efficient event model kqueue similar to Epoll on the OpenBSD or FreeBSD operating system.

Installation process

The installation process requires familiarity with the Linux network and the knowledge of configuring yum sources

Download it and transfer it to the server. The first step is to decompress

tar -zxvf nginx-1.13.1.tar.gz

How to install, start, restart and stop Nginx under Linux

Enter the directory of nginx-1.13.1 and view The following file

How to install, start, restart and stop Nginx under Linux

found that nginx is released through the source package, and nginx is written in C, so a c/c compiler needs to be installed

yum install gcc

How to install, start, restart and stop Nginx under Linux

How to install, start, restart and stop Nginx under Linux## As above, gcc has been installed, let’s install nginx

How to install, start, restart and stop Nginx under Linux

How to install, start, restart and stop Nginx under LinuxAt the end of the detection, it was found that the dependent pcre library was not available. Let’s install pcre

https://ftp.pcre.org/pub/pcre/

After downloading pcre, you will also need to decompress the tar.gz file first.

tar -zxvf pcre-8.00.tar.gz

How to install, start, restart and stop Nginx under LinuxAfter decompression, there are the following files, which are still source code installations

How to install, start, restart and stop Nginx under Linux

How to install, start, restart and stop Nginx under Linux

How to install, start, restart and stop Nginx under Linux

##It says that we can't find g, let's install g How to install, start, restart and stop Nginx under Linux

yum install gcc-c

Come back and continue to install pcreHow to install, start, restart and stop Nginx under Linux

./configure

make install

pcre installation is complete, go back and install nginxHow to install, start, restart and stop Nginx under Linux

Zlib is missing, we need Install zlib againHow to install, start, restart and stop Nginx under Linux

http://www.zlib.net/

zlib is also managed by tar.gz, unzip it first

I found that zlib is also managed by the source code package, to install zlibHow to install, start, restart and stop Nginx under Linux

./configure

make install

After the installation is completed, install nginx

./configure

make install

This time the installation was finally successful. The software is installed to

/usr/local/nginx

Start nginx

./usr/local/nginx/sbin/nginx

Access nginx( The ip address is: 192.168.100.100, the port number is: 80)

http://192.168.100.100:8080/

nginx is installed successfully.

How to install, start, restart and stop Nginx under Linux

Nginx stop and restart commands

Stop nginx

nginx -s stop

Restart nginx

nginx -s reload

What is a Linux system

Linux is a UNIX-like operating system that is free to use and spread freely. It is a POSIX-based multi-user, multi-tasking, multi-threading and A multi-CPU operating system that uses Linux to run major Unix tool software, applications, and network protocols.

The above is the detailed content of How to install, start, restart and stop Nginx under Linux. For more information, please follow other related articles on the PHP Chinese website!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to create a mirror in docker How to create a mirror in docker Apr 15, 2025 am 11:27 AM

Steps to create a Docker image: Write a Dockerfile that contains the build instructions. Build the image in the terminal, using the docker build command. Tag the image and assign names and tags using the docker tag command.

How to use docker desktop How to use docker desktop Apr 15, 2025 am 11:45 AM

How to use Docker Desktop? Docker Desktop is a tool for running Docker containers on local machines. The steps to use include: 1. Install Docker Desktop; 2. Start Docker Desktop; 3. Create Docker image (using Dockerfile); 4. Build Docker image (using docker build); 5. Run Docker container (using docker run).

How to check the name of the docker container How to check the name of the docker container Apr 15, 2025 pm 12:21 PM

You can query the Docker container name by following the steps: List all containers (docker ps). Filter the container list (using the grep command). Gets the container name (located in the "NAMES" column).

How to create containers for docker How to create containers for docker Apr 15, 2025 pm 12:18 PM

Create a container in Docker: 1. Pull the image: docker pull [mirror name] 2. Create a container: docker run [Options] [mirror name] [Command] 3. Start the container: docker start [Container name]

How to start containers by docker How to start containers by docker Apr 15, 2025 pm 12:27 PM

Docker container startup steps: Pull the container image: Run "docker pull [mirror name]". Create a container: Use "docker create [options] [mirror name] [commands and parameters]". Start the container: Execute "docker start [Container name or ID]". Check container status: Verify that the container is running with "docker ps".

vscode cannot install extension vscode cannot install extension Apr 15, 2025 pm 07:18 PM

The reasons for the installation of VS Code extensions may be: network instability, insufficient permissions, system compatibility issues, VS Code version is too old, antivirus software or firewall interference. By checking network connections, permissions, log files, updating VS Code, disabling security software, and restarting VS Code or computers, you can gradually troubleshoot and resolve issues.

What computer configuration is required for vscode What computer configuration is required for vscode Apr 15, 2025 pm 09:48 PM

VS Code system requirements: Operating system: Windows 10 and above, macOS 10.12 and above, Linux distribution processor: minimum 1.6 GHz, recommended 2.0 GHz and above memory: minimum 512 MB, recommended 4 GB and above storage space: minimum 250 MB, recommended 1 GB and above other requirements: stable network connection, Xorg/Wayland (Linux)

What to do if the docker image fails What to do if the docker image fails Apr 15, 2025 am 11:21 AM

Troubleshooting steps for failed Docker image build: Check Dockerfile syntax and dependency version. Check if the build context contains the required source code and dependencies. View the build log for error details. Use the --target option to build a hierarchical phase to identify failure points. Make sure to use the latest version of Docker engine. Build the image with --t [image-name]:debug mode to debug the problem. Check disk space and make sure it is sufficient. Disable SELinux to prevent interference with the build process. Ask community platforms for help, provide Dockerfiles and build log descriptions for more specific suggestions.

See all articles