nginx的编译安装(linux centos6)及其介绍

本文详细介绍了在CentOS6上编译安装nginx的步骤,包括下载源码、解决依赖、编译配置、启动和测试。同时,讲解了nginx的模块功能,如http_core_module、http_access_module等,并探讨了nginx的目录结构和主配置文件内容。在安装过程中,还解决了因依赖问题导致的编译错误。
摘要由CSDN通过智能技术生成
一、nginx的编译安装

1、下载源码包
到官网复制源码包的链接地址

[root@myp ~]# wget http://nginx.org/download/nginx-1.12.1.tar.gz
[root@myp ~]# ls   (可以查看到下载的安装包)

2、解压

[root@myp ~]# tar xf  nginx-1.12.1.tar.gz 

3、编译并安装(如果之前用了其他方式安装了nginx,先停掉nginx -s stop)

[root@bogon ~]# cd nginx-1.12.1
[root@bogon nginx-1.12.1]# ./configure --prefix=/usr/local/nginx
(/usr/local/nginx这个目录之前是没有的)

但是由于还没有安装一些依赖工具,会有以下提示

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.

【意思是说http服务(nginx提供的就是http服务)中的重写功能需要pcre库的支持,如果需要这个功能就要下载pcre库,不然就加–without-http_rewrite_module这个选项来禁用http的重写功能】
但是安装pcre的时候发现又有依赖的工具。所以一下子把nginx依赖的工具都安装了吧

yum install mysql php php-fpm pcre-devel openssl-devel gcc automake zlib-devel

automake:http://www.cnblogs.com/ericdream/archive/2011/12/09/2282359.html(可以参考这篇文章,牵扯到的东西还是挺多的)

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值