linux下安装nginx

本文介绍在CentOS 64位系统中安装Nginx的步骤,并解决了配置过程中可能遇到的关于PCRE库、OpenSSL库及zlib库缺失的问题。
linux系统为Centos 64位

第一步:从http://nginx.org/download/上下载相应的版本(或者wget http://nginx.org/download/nginx-1.9.8.tar.gz直接在Linux上用命令下载)

第二步:解压 tar -zxvf nginx-1.9.8.tar.gz

第三步:设置一下配置信息 ./configure --prefix=/usr/local/nginx ,或者不执行此步,直接默认配置

第四步:

make 编译 (make的过程是把各种语言写的源码文件,变成可执行文件和各种库文件)

make install 安装 (make install是把这些编译出来的可执行文件和库文件复制到合适的地方)



在配置信息的时候,也就是在第三步,出现了一下错误:
[img]http://images.cnitblog.com/i/448111/201403/292000503917699.jpg[/img]

错误为:./configure: error: the HTTP rewrite module requires the PCRE library.

安装pcre-devel解决问题
yum -y install pcre-devel

还有可能出现:

错误提示:./configure: error: the HTTP cache module requires md5 functions
from OpenSSL library. You can either disable the module by using
--without-http-cache option, or install the OpenSSL library into the system,
or build the OpenSSL library statically from the source with nginx by using
--with-http_ssl_module --with-openssl=<path> options.

解决办法:

yum -y install openssl openssl-devel

还有可能出现:
[color=red][b]./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using –without-http_gzip_module
option, or install the zlib library into the system, or build the zlib
library
statically from the source with nginx by using –with-zlib=<path> option.[/b][/color]
则需要安装“zlib-devel”即可。SSH执行以下命令:
yum install -y zlib-devel

参考:[url]http://www.cnblogs.com/kunhu/p/3633002.html[/url]

Nginx源码安装:[url]http://blog.youkuaiyun.com/xyang81/article/details/51476293[/url]

Nginx 服务器安装及配置文件详解:
[url]http://www.cnblogs.com/bluestorm/p/4574688.html[/url]
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值