centos7安装nginx(gz)
1.解压下载完成的 nginx.gz 包
tar -zxvf nginx.gz
2.进入解压好的目录执行 ./configure,如果要安装 ssl 则需要执行 ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-file-aio --with-http_realip_module
如果报错
1)error: the HTTP rewrite module requires the PCRE library.
解决办法:
yum -y install pcre-devel
2)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
3.编译
make
4.安装
make install
小编安装 ngxin 就是默认路径可以根据需求修改 ngxin 的安装路径