centos下安装nginx简明教程

发布时间:2020-06-05编辑:脚本学堂
本文介绍了centos中安装nginx服务器软件的方法,centos中编译安装nginx服务的例子,不明白如何编译安装nginx的朋友,不妨参考下。

centos编译安装nginx简单步骤:

1、先下载nginx源码
 
2、解压到某个目录
 
3、./configure --prefix=/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.
说明缺少了pcre库
 
1)安装pcre-devel
 

复制代码 代码示例:
yum install pcre-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
 
2)安装zlib-devel
 

复制代码 代码示例:
yum install zlib-devel

5、安装
 

复制代码 代码示例:
make &&make install

不出异外的话,是顺利安装成功。
当然了,以上只是一个演示,教给大家linux操作系统中编译安装nginx的方法与基本步骤。

更多nginx安装教程,请参考以下文章: