What is Nginx?
1.Nginx is a lightweight Web server that can be used as a reverse proxy.
2.Nginx occupies less memory, Nginx took a phased resource allocation technology, making it CPU and memory occupancy rate is very low.
3. Anti-concurrency ability. Processing requests are asynchronous and non-blocking, while Apache is blocking, and nginx can keep low resource consumption and high performance in high concurrency.
4. Highly modular design, writing modules relatively simple, community active, a variety of high-performance modules produced quickly
Nginx Process issues:
Nginx There are at least two processes, one process is called Master, and the other process is called worker. (Always master process multiple threads)
Source Installation:
./configure \
--PREFIX=/USR \--sbin-path=/usr/sbin/nginx \--conf-path=/etc/nginx/nginx.conf \--error-log-
Path=/var/log/nginx/error.log \--http-log-path=/var/log/nginx/access.log \--pid-
Path=/var/run/nginx/nginx.pid \--lock-path=/var/lock/nginx.lock \--user=nginx \--group=nginx \--with-
Http_ssl_module \--with-http_flv_module \--with-http_stub_status_module \--with-http_gzip_static_module \
--http-client-body-temp-path=/var/tmp/nginx/client/\--http-proxy-temp-path=/var/tmp/nginx/proxy/\--
http-fastcgi-temp-path=/var/tmp/nginx/fcgi/\--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi \--http-scgi-
TEMP-PATH=/VAR/TMP/NGINX/SCGI \--with-pcre
#make (or Make-j 4 speed up compilation, how many CPU cores you can write)
#make Install (the program is installed by default under/usr/local/nginx)
syntax check for errors:
#nginx-T
start Nginx:
#systemctl start Nginx
To stop Nginx:
#sytemctl Stop Nginx
To load a configuration file:
#systemctl Reload Nginx
Nginx source Installation (a Web server that can do reverse proxy)