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.
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 processThe installation process requires familiarity with the Linux network and the knowledge of configuring yum sourcesDownload it and transfer it to the server. The first step is to decompress tar -zxvf nginx-1.13.1.tar.gz Enter the directory of nginx-1.13.1 and view The following file 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
## As above, gcc has been installed, let’s install nginx
At 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
After decompression, there are the following files, which are still source code installations
##It says that we can't find g, let's install g
yum install gcc-cCome back and continue to install pcre
./configure make installpcre installation is complete, go back and install nginx
Zlib is missing, we need Install zlib again
http://www.zlib.net/zlib is also managed by tar.gz, unzip it firstI found that zlib is also managed by the source code package, to install zlib
./configuremake installAfter the installation is completed, install nginx ./configuremake installThis time the installation was finally successful. The software is installed to /usr/local/nginxStart nginx./usr/local/nginx/sbin/nginxAccess nginx( The ip address is: 192.168.100.100, the port number is: 80)http://192.168.100.100:8080/nginx is installed successfully.Stop nginx
nginx -s stop
Restart nginx
nginx -s reload
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!