Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction and installation of Nginx

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

nginx

Nginx (engine x) is a high-performance HTTP and reverse proxy web server that also provides IMAP/POP3/SMTP services. Nginx was developed by Igor Sesoyev for Russia's second most visited Rambler.ru site (Russian: Рамблер), with the first public version 0.1.0 released on October 4, 2004.

It distributes its source code under a BSD-like license and is known for its stability, rich feature set, sample configuration files, and low system resource consumption. On June 1, 2011, nginx 1.0.4 was released.

Nginx is a lightweight Web server/reverse proxy server and email (IMAP/POP3) proxy server distributed under the BSD-like protocol. It is characterized by less memory and strong concurrency ability. In fact, nginx's concurrency ability performs well in web servers of the same type. Users of nginx websites in the mainland of China include Baidu, Jingdong, Sina, Netease, Tencent, Taobao, etc.

Difference between nginx and Apache

Apache:

Apache rewrite is more powerful than nginx. In the case of frequent rewrite, apache has developed to the present. There are many modules. The basic ideas can be found. apache is more mature, less bugs, and nginx bugs are relatively more. apache is super stable. apache supports PHP more simply. nginx needs to cooperate with other backends. apache has an advantage in handling dynamic requests. nginx is ji in this respect. Rib, general dynamic request to apache to do, nginx suitable for static and reverse. Apache is still mainstream today, with rich features, mature technology, and a development community.

Nginx:

Lightweight, written in C, the same web service, will occupy less memory and resources anti-concurrency, nginx to epoll and kqueue as the development model, processing requests is asynchronous non-blocking, load capacity is much higher than apache, and apache is blocking. Under high concurrency, nginx can maintain low resource consumption and high performance, while apache can easily cause a surge in the number of processes in PHP or a lot of front-end pressure, thus denying service. nginx handles static files well, static processing performance is more than three times higher than apache nginx design is highly modular, the writing module is relatively simple nginx configuration is simple, regular configuration makes many things simple, and after changing the configuration can use-t test configuration has no problems, apache configuration is complex, when restarting found configuration errors, it will crash nginx as a Load Balancer server, support 7 layers of Load Balancer nginx itself is a reverse proxy server, And it can be used as a very good mail proxy server

Summary:

In general, web services that require performance use nginx. If you don't need performance, just stability, consider apache. A more general solution is that the front-end nginx anti-concurrency, back-end apache cluster, together will be better.

Nginx Installation

Nginx download: nginx.org/download/nginx-1.15.9.tar.gz

#Decompress

tar -xvf nginx-1.15.9.tar.gzcd nginx-1.15.9

#Compile installation

./ configure --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.42 make && make install

#View Version

The requested URL/usr/webserver/nginx/sbin/nginx-vnginx was not found on this server.

#Create Nginx Program User User Nginx

/usr/sbin/groupadd nginx/usr/sbin/useradd -g nginx nginx

#Create soft connections

ln -s /usr/local/nginx/bin/* /usr/local/bin

#Start nginx

nginx

#Start successfully, visit successful pages

Simple installation, theory must be understood.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report