天天看点

Nginx简单安装Welcome to nginx!

优点:配置简单  更灵活   高并发(静态小文件) 占用资源少  功能种类多  支持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,如需转载请自行联系原作者

继续阅读