`

linux下安装nginx

 
阅读更多
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是把这些编译出来的可执行文件和库文件复制到合适的地方)



在配置信息的时候,也就是在第三步,出现了一下错误:


错误为:./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

还有可能出现:
./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.

则需要安装“zlib-devel”即可。SSH执行以下命令:
yum install -y zlib-devel

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

Nginx源码安装:http://blog.csdn.net/xyang81/article/details/51476293

Nginx 服务器安装及配置文件详解:
http://www.cnblogs.com/bluestorm/p/4574688.html
分享到:
评论

相关推荐

    linux下安装Nginx所需依赖包

    在Linux环境下安装Nginx,需要先确保系统已经准备好所有必要的依赖包,这样才能确保Nginx能够正常运行。 首先,我们要知道Linux发行版的不同会影响安装方式和依赖包的选择。常见的Linux发行版如Ubuntu/Debian和...

    linux安装nginx/1.25.2

    linux安装nginx/1.25.2,并配置systemctl管理nginx的启动关闭状态等

    linux安装nginx并支持ssl

    linux安装nginx并支持ssl,使得服务器支持证书签名,提升应用的安全性

    linux安装nginx的rpm包

    本文将详细介绍如何使用RPM包在Linux上安装Nginx,以实现高效稳定的Web服务。 首先,了解RPM(Red Hat Package Manager)是Linux发行版如CentOS、Fedora等常用的一种软件包管理器,它负责安装、升级和卸载软件。在...

    linux 下安装nginx步骤及命令

    Linux 下安装 Nginx 步骤及命令 Linux 操作系统中安装 Nginx 服务器的步骤和命令详解。该文档将指导用户从头开始安装 Nginx,包括安装 OpenSSL、GCC、PCRE 和 Zlib 库,并最终安装 Nginx 服务器。 安装 OpenSSL --...

Global site tag (gtag.js) - Google Analytics