Nginx
Introduction
Nginx is a lightweight web server/reverse proxy server and email (IMAP/POP3) proxy server, and is released under a BSD-like protocol. The installation is very simple, the configuration file is very concise (it can also support perl syntax), there are very few bugs, it occupies less memory, it has strong concurrency capabilities, it is very easy to start, and it can run almost 7*24 without interruption, even if it runs for several months There is no need to restart, and you can upgrade the software version without interrupting service. In fact, the concurrency capabilities of nginx do perform better among web servers of the same type. Users of nginx websites in mainland China include: Baidu, Sina, NetEase, Tencent, Taobao, etc.
Download and install
Download the latest version nginx-1.9.7.tar.gz
#tar zxvf nginx-1.9.7.tar.gz
#cd nginx-1.9.7
#./configure && make && make install
Configuration
#vim /usr/local/nginx/conf/nginx.conf
Content format:
http {
Server {
/*Here are the key configuration parameters* /
}
}
First block all existing server blocks, that is, server{}, and then add one yourself
server {
listen 80;//Server-side listening Port er server_name localhost 10.1.1.25; // The service side address
local/{
root/data/www; // The service terminal machine actual access when accessing the root directory interviews the root directory Directory
}
Location /images/ {
, external access http://10.1.1.25/images /qq.png failed
10.1.1.25/images The failure of always failed
}}
Start
#/usr/local/nginx/sbin/nginx
Stop
#/ usr/local/nginx/sbin/nginx -s quit or
#
/usr/local/nginx/sbin/nginx -sshutdown
Reload the configuration file
#/usr/local/nginx/sbin/nginx -s reload
For details, please refer to the official documentation:http://nginx.org/en/docs/beginners_guide.html
The above introduces the initial test of nginx, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.