優點:配置簡單 更靈活 高并發(靜态小檔案) 占用資源少 功能種類多 支援epoll模型 配合動态服務和apache有差別 對IP限速,可以限制連結數
LNMP實作原理 架構:
nginx 80 fastcgi_pass http:ip:9000 PHP FCGI(服務) 9000端口
apache 是子產品 DSO apxs select模型
nginx是起CGI epoll網絡I/O模型
nginx.org
# ntpdate cn.pool.ntp.org 更新系統時間
開始安裝
安裝準備
安裝 pcre 中文perl相容正規表達式 為了支援http rewrite 僞靜态 安裝 openssl
yum -y install pcre* openssl openssl-devel
useradd -s /sbin/nologin -M nginx
tar xf nginx-1.9.15.tar.gz
cd nginx-1.9.15
./configure --user=nginx --group=nginx --prefix=/application/nginx1.9.15 --with-http_stub_status_module --with-http_ssl_module
make && make install
ln -s /application/nginx1.9.15/ /application/nginx
啟動nginx
/application/nginx/sbin/nginx -t
/application/nginx/sbin/nginx
netstat -lntup | grep nginx
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 12590/nginx
本文轉自 295631788 51CTO部落格,原文連結:http://blog.51cto.com/hequan/1767646,如需轉載請自行聯系原作者