In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
The concept of Nginx website Service Nginx
Nginx (engine x) is a high-performance HTTP and reverse proxy web server, while also providing IMAP/POP3/SMTP services. Nginx was developed by Igor Sesoyev for the second most visited Ramblerru site in Russia (Russian: Pamonep), a public version 0. 0. 1.0 was released on October 4, 2004.
distributes its source code as a BSD-like license and is known for its stability, rich feature set, sample configuration files, and low consumption of system resources. Nginx 1.0.4 was released on June 1, 2011.
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, the concurrency ability of nginx performs better in the same type of web server. Chinese mainland uses nginx website users: Baidu, JD.com, Sina, NetEase, Tencent, Taobao and so on.
Nginx manual compilation and installation
Installation environment: Centos7, nginx-1.12.0.tar.gz
The details of the manual compilation and installation process of Nginx are as follows:
# Nginx sets nginx-1.12.0.tar.gz 1. Decompress the package tar zxf nginx-1.12.0 tar.gz-C / opt/2. Install the required compiler installation environment package yum install gcc gcc-c++ pcre pcre-devel zlib-devel-y3. Create a home directory but not a home directory useradd-M-s / sbin/nologin nginx4. Configure the related parameters cd / opt/nginx-1.12.0./configure\-- prefix=/usr/local/nginx\-- user=nginx\-- group=nginx\-- with-http_stub_status_module (statistical module) 5. Compile and install make & & make install6. Test # cd / usr/local/nginx # ls#conf html logs sbin ln-s / usr/local/nginx/sbin/nginx / usr/local/sbin/#nginx-t nginx netstat-natp | grep 80systemctl stop firewalld.service setenforce 0#yum install-y elinks (test web tool) # elinks http://localhost 7.# basic management killall-3 (- s QUIT) nginx netstat-antp | grep 80killall-1 (- s HUP) nginx8. Make the management script Nginx to compile and install the instance [root@localhost ~] # yum install gcc gcc-c++ pcre pcre-devel zlib-devel-y [root@localhost ~] # cd LNMP-C7/ [root@localhost LNMP-C7] # lsDiscuz_X3.4_SC_UTF8.zip php-7.1.10.tar.bz2mysql-boost-5.7.20.tar.gz php-7.1.20.tar.bz2ncurses-5.6.tar.gz php-7. 1.20.tar.gznginx-1.12.2.tar.gz zend-loader-php5.6-linux-x86_64_update1.tar.gzphp-5.6.11.tar.bz2 [root@localhost LNMP-C7] # tar zxf nginx-1.12.2.tar.gz-C / opt/ [root@localhost nginx-1.12.2] # useradd-M-s / sbin/nologin nginx [root@localhost LNMP-C7] # cd / opt/ [root@localhost opt] # cd Nginx-1.12.2/ [root@localhost nginx-1.12.2] #. / configure\ >-- prefix=/usr/local/nginx\ >-- user=nginx\ >-- group=nginx\ >-- with-http_stub_status_module.// omits part of the content nginx http proxy temporary files: "proxy_temp" nginx http fastcgi temporary files: "fastcgi_temp" nginx http uwsgi temporary files: "uwsgi_temp" nginx http scgi temporary files: " Scgi_temp "[root@localhost nginx-1.12.2] # make & & make install...// omits part of the content test-d'/ usr/local/nginx/logs'\ | | mkdir-p'/ usr/local/nginx/logs'make [1]: Leaving directory `/ opt/nginx-1.12.2' [root@localhost nginx-1.12.2] # ln-s / usr/local/nginx/sbin/nginx / usr/local/sbin/ [root @ localhost nginx-1.12.2] # ln-s / usr/local/nginx/sbin/nginx / usr/local/sbin/ [root@localhost nginx-1.12.2] # nginx- tnginx: the configuration file / usr/local/nginx/conf/nginx.conf syntax is oknginx: configuration file / usr/local/nginx/conf/nginx.conf test is successful [root@localhost nginx-1.12.2] # nginx [root@localhost nginx-1.12.2] # netstat-natp | grep nginxtcp 00 0.0.0.0 root@localhost nginx-1.12.2 80 0.0.0.0 root@localhost nginx-1.12.2 * LISTEN 66585/nginx: master [root@localhost nginx-1.12.2] # systemctl stop firewalld.service [root@localhost nginx-1.12.2] # setenforce 0 [root@localhost nginx-1.12.2] # yum install-y elinks [root@localhost nginx-1.12.2] # elinks http://localhost// displays the dialog box after executing the command here Enter ok, enter Q and select yes to exit to the original interface.
The above is the process of manual compilation and installation of Nginx. Let's introduce the basic management commands for Nginx.
Basic management of Nginx [root@localhost nginx-1.12.2] # killall-3 nginx / / disable Nginx service [root@localhost nginx-1.12.2] # netstat-natp | grep nginx [root@localhost nginx-1.12.2] # nginx / / start Nginx service [root@localhost nginx-1.12.2] # killall-1 nginx / / restart Nginx service [root@localhost nginx-1.12.2] # netstat- Natp | grep nginxtcp 0 0 0.0.0.0 LISTEN 76326/nginx: master / / you can also use the following command to shut down and restart killall-s QUIT nginx killall-s HUP nginx [root@localhost nginx-1.12.2] # killall-s QUIT nginx [root@localhost nginx-1.12.2] # netstat-natp | grep nginx [root@localhost nginx -1.12.2] # nginx [root@localhost nginx-1.12.2] # killall-s HUP nginx [root@localhost nginx-1.12.2] # netstat-natp | grep nginxtcp 0 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
The above basic management is relatively inconvenient, we can make a management script, the script is as follows
Vim / EtcUnip init.dPROG PROG:-99 2 steps description: Nginx Service Control ScriptPROG= "/ usr/local/nginx/sbin/nginx" PIDF= "/ usr/local/nginx/logs/nginx.pid" case "$1" in start) $PROG;; stop) kill-s QUIT $(cat $PIDF);; restart) $0 stop $0 start Reload) kill-s HUP $(cat $PIDF); *) echo "Usage: $0 {start | stop | restart | reload}" exit 1esacexit 0 [root@localhost init.d] # chmod + x nginx [root@localhost init.d] # chkconfig-add nginx [root@localhost init.d] # service nginx restart Summary
This article mainly explains the relevant basic points about Nginx. What we need to know is its own characteristics and the difference between it and Apache.
Features: stability, lightweight, high concurrency, low resources
Advantages: good at dealing with static websites (pictures, text, videos, etc.) access resources
Apache is good at dynamic (e.g. interaction required for account registration)
In the next article, we will introduce how to build a Nginx virtual host on the basis of manually compiling and installing Nginx services. thank you for reading!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.