./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.
解决方法:yum install pcre pcre-devel -y
./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.
解决方法:yum install openssl openssl-devel -y
报错信息如下:
[root@gjlin2 pcre-8.30]# make && make install
make all-am
make[l]: Entering directory 7h〇me/gjlin/tools/pcre-8.30*
CXX pcrecpp.lo
libtool: compile : unrecognized option '-DHAVE_CONFIG_H'
libtool:compile : Try 'libtool --help' for more information.
make[l]:***[pcrecpp.lo]错误 1
make[l]:Leaving directory '/home/gjlin/tools/pcre-8.30'
make : *** [all]错误 2
解答:执行"yum -y install gcc-c++"命令安装gcc-c++依赖包。
[root@web01 nginx-1.10.2]# /application/nginx/sbin/nginx
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
解决方法:nginx软件已经启动无需反复启动,如果需要重新启动需要停止nginx进程或者用reload方式进行重启
解答:这是因为没有对应的Nginx服务用户,执行useradd nginx -s /sbin/nologin -M创建Nginx用户即可。为了让读者理解问题,重现上述错误过程,命令如下:
[root@web tools]# pkill nginx
[root@web tools]# userdel nginx
[root@web tools]# /application/nginx/sbin/nginx
nginx: [emerg] getpwnam(Mnginx") failed
[root@web tools]# useradd nginx -s /sbin/nologin -M
[root@web tools]# /application/nginx/sbin/nginx