1、上传安装包到服务器,或者通过wget下载安装包
2、
3、解压压缩包
tar zxvf nginx-1.18.0.tar.gz
4、进入解压目录下进行安装
./configure --prefix=/usr/local/nginx
报错:
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
yum install pcre 及 yum install pcre-devel
再次运行./configure --prefix=/usr/local/nginx
报错:
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 sourc