CentOS6编译安装Nginx-1.8.1

Nginx介绍

Nginx ("engine x") 是一个高性能的HTTP和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 服务器。Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,第一个公开版本0.1.0发布于2004年10月4日。其将源代码以类BSD许可证的形式发布,因它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名。

特点:
Nginx是一款面向性能设计的HTTP服务器,相较于Apache、lighttpd具有占有内存少,稳定性高等优势。

优点:
1.处理静态文件,索引文件以及自动索引;打开文件描述符缓冲.
2.无缓存的反向代理加速,简单的负载均衡和容错.
3.FastCGI,简单的负载均衡和容错.
4.模块化的结构。包括gzipping, byte ranges, chunked responses, 以及 SSI-filter等filter。如果由FastCGI或其它代理服务器处理单页中存在的多个SSI,则这项处理可以并行运行,而不需要相互等待。
5.支持SSL 和 TLS SNI.

安装依赖包

1.pcre库 perl兼容正则表达式
安装pcre库后nginx可以使用URI重写功能和rewrite模块。
检查pcre是否安装
[root@linuxidc ~]# rpm -qa pcre pcre-devel
pcre-devel-7.8-7.el6.x86_64
pcre-7.8-7.el6.x86_64
可以使用yum安装
[root@linuxidc ~]# yum install pcre pcre-devel -y

2.openssl-devel
安装openssl-devel后nginx可以使用加密服务
检查openssl-devel是否安装
[root@localhost~]# rpm -qa openssl-devel
openssl-devel-1.0.1e-42.el6_7.4.x86_64
可以使用yum安装
[root@localhost~]# yum install openssl-devel -y

安装nginx
下载nginx
[root@localhost app]# wget http://nginx.org/download/nginx-1.8.1.tar.gz

如果在命令行下载不了,可以百度上下载好后再上传
[root@llocalhost app]# ls -l nginx-1.8.1.tar.gz 
-rw-r--r-- 1 root root 833473 1月  27 00:30 nginx-1.8.1.tar.gz
解压
[root@llocalhost app]# tar -zxvf nginx-1.8.1.tar.gz 
编译安装
[root@llocalhost app]# cd nginx-1.8.1
编译参数
./configure  --prefix=/usr/local/app/nginx  --with-http_stub_status_module  --with-http_ssl_module
make
make install


启动nginx
检查语法
[root@llocalhost nginx]# ./nginx -t
nginx: the configuration file /usr/local/app/nginx1.8.1/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/app/nginx1.8.1/conf/nginx.conf test is successful
启动
[root@llocalhost nginx]# nginx

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值