首页 > 其他 > 详细

nginx 学习

时间:2018-04-03 12:35:35      阅读:200      评论:0      收藏:0      [点我收藏+]
Nginx 是高性能http和反向代理服务器
Nginx 是由内核和模块组成的。
Nginx 和apache 区别
高并发能力强于apache ,5w/s
反向代理非常强
Nginx 占用内存非常小
健康检测的功能
Nginx 支持 cgi和fastcgi
Nginx 是采用epoll(事件响应,不是遍历) 模型 apache 采用是select(遍历整个仓库)

Nginx 核心模块
Http 模块、event 模块 mail 模块
Nginx 的基础模块
http Access 模块、FastCGI 模块、Proxy 模块 和rewrite 模块
第三方模块
Http upstream request hash 模块,Notice 模块 ,http access key 模块


Nginx 源码安装

1、 wget http://nginx.org/download/nginx-1.12.2.tar.gz
2、 yum install pcre-devel -y (安装正则库)
3、 yum -y install gcc gcc-c++ autoconf automake make
4、 yum -y install openssl openssl-devel
5、 tar -zxvf nginx-1.12.2.tar.gz
6、 cd nginx-12.2
7、 隐藏版本号 (可选)
sed -i -e ‘s/1.12.2//g‘ -e ‘s/nginx\//WS/g‘ -e ‘s/”NGINX”/”WS”/g‘ src/core/nginx.h

8、 useradd nginx
9、 ./configure --user=nginx --group=nignx --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
10、 make
11、 make install
12、 启动 /usr/local/nginx/sbin/nginx
13、 检测配置 /usr/local/nginx/sbin/nginx -t
14、 查看版本 /usr/local/nginx/sbin/nginx -v

nginx 学习

原文:http://blog.51cto.com/9561203/2094158

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!