search
HomeOperation and MaintenanceNginxHow to install, start, restart and stop Nginx under Linux

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
This article is reproduced at:亿速云. If there is any infringement, please contact admin@php.cn delete
NGINX vs. Apache: Comparing Web Server TechnologiesNGINX vs. Apache: Comparing Web Server TechnologiesMay 02, 2025 am 12:08 AM

NGINX is suitable for handling high concurrency and static content, while Apache is suitable for dynamic content and complex URL rewrites. 1.NGINX adopts an event-driven model, suitable for high concurrency. 2. Apache uses process or thread model, which is suitable for dynamic content. 3. NGINX configuration is simple, Apache configuration is complex but more flexible.

NGINX and Apache: Deployment and ConfigurationNGINX and Apache: Deployment and ConfigurationMay 01, 2025 am 12:08 AM

NGINX and Apache each have their own advantages, and the choice depends on the specific needs. 1.NGINX is suitable for high concurrency, with simple deployment, and configuration examples include virtual hosts and reverse proxy. 2. Apache is suitable for complex configurations and is equally simple to deploy. Configuration examples include virtual hosts and URL rewrites.

NGINX Unit's Purpose: Running Web ApplicationsNGINX Unit's Purpose: Running Web ApplicationsApr 30, 2025 am 12:06 AM

The purpose of NGINXUnit is to simplify the deployment and management of web applications. Its advantages include: 1) Supports multiple programming languages, such as Python, PHP, Go, Java and Node.js; 2) Provides dynamic configuration and automatic reloading functions; 3) manages application lifecycle through a unified API; 4) Adopt an asynchronous I/O model to support high concurrency and load balancing.

NGINX: An Introduction to the High-Performance Web ServerNGINX: An Introduction to the High-Performance Web ServerApr 29, 2025 am 12:02 AM

NGINX started in 2002 and was developed by IgorSysoev to solve the C10k problem. 1.NGINX is a high-performance web server, an event-driven asynchronous architecture, suitable for high concurrency. 2. Provide advanced functions such as reverse proxy, load balancing and caching to improve system performance and reliability. 3. Optimization techniques include adjusting the number of worker processes, enabling Gzip compression, using HTTP/2 and security configuration.

NGINX vs. Apache: A Look at Their ArchitecturesNGINX vs. Apache: A Look at Their ArchitecturesApr 28, 2025 am 12:13 AM

The main architecture difference between NGINX and Apache is that NGINX adopts event-driven, asynchronous non-blocking model, while Apache uses process or thread model. 1) NGINX efficiently handles high-concurrent connections through event loops and I/O multiplexing mechanisms, suitable for static content and reverse proxy. 2) Apache adopts a multi-process or multi-threaded model, which is highly stable but has high resource consumption, and is suitable for scenarios where rich module expansion is required.

NGINX vs. Apache: Examining the Pros and ConsNGINX vs. Apache: Examining the Pros and ConsApr 27, 2025 am 12:05 AM

NGINX is suitable for handling high concurrent and static content, while Apache is suitable for complex configurations and dynamic content. 1. NGINX efficiently handles concurrent connections, suitable for high-traffic scenarios, but requires additional configuration when processing dynamic content. 2. Apache provides rich modules and flexible configurations, which are suitable for complex needs, but have poor high concurrency performance.

NGINX and Apache: Understanding the Key DifferencesNGINX and Apache: Understanding the Key DifferencesApr 26, 2025 am 12:01 AM

NGINX and Apache each have their own advantages and disadvantages, and the choice should be based on specific needs. 1.NGINX is suitable for high concurrency scenarios because of its asynchronous non-blocking architecture. 2. Apache is suitable for low-concurrency scenarios that require complex configurations, because of its modular design.

NGINX Unit: Key Features and CapabilitiesNGINX Unit: Key Features and CapabilitiesApr 25, 2025 am 12:17 AM

NGINXUnit is an open source application server that supports multiple programming languages ​​and provides functions such as dynamic configuration, zero downtime updates and built-in load balancing. 1. Dynamic configuration: You can modify the configuration without restarting. 2. Multilingual support: compatible with Python, Go, Java, PHP, etc. 3. Zero downtime update: Supports application updates that do not interrupt services. 4. Built-in load balancing: Requests can be distributed to multiple application instances.

See all articles

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment