编译安装nginx过程中出现的错误
执行 make 报错
make: *** No rule to make target build, needed by default. Stop.
解决方式:
更新yum
yum update
更新完成后,先删除之前准备make的nginx包,然后重新解压一个。
安装前置库:
[root@cqakserver local]# yum install -y gcc pcre pcre-devel openssl openssl-devel gd gd-devel
删除原来解压缩目录,重新编译安装
./configure: error: the HTTP gzip module requires the zlib library.
则需要安装“zlib-devel”即可。SSH执行以下命令:
yum install -y zlib-devel
./configure: error: the HTTP rewrite module requires the PCRE library.
yum -y install pcre-devel
./configure: error: the HTTP cache module requires md5 functions
from OpenSSL library.
yum -y install openssl openssl-devel
判断Nginx配置是否正确
nginx -t -c /usr/nginx/conf/nginx.conf
或者
/usr/nginx/sbin/nginx -t