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
错误:
./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
5、安装
不出异外的话,是顺利安装成功。
当然了,以上只是一个演示,教给大家linux操作系统中编译安装nginx的方法与基本步骤。
更多nginx安装教程,请参考以下文章: