安装nginx出现的问题

时间:2022-04-27
本文章向大家介绍安装nginx出现的问题,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
  1. 问题一
  • 初始化的时候,提示没有这个文件
[root@localhost src]# ./configure --prefix=/usr/local/nginx
-bash: ./configure: 没有那个文件或目录
  • 解决方法:
    • 因为目录路径错了,导致无法初始化,需要切换到nginx-1.12.1目录下初始化
[root@localhost src]# cd nginx-1.12.1
[root@localhost nginx-1.12.1]#
  1. 问题二
初始化的时候,遇到的
checking for C compiler ... not found

./configure: error: C compiler cc is not found
  • 解决办法:
    • 安装包yum -y install gcc
  1. 问题三
初始化的时候,遇到的
./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 -y pcre-deve
    • 安装包yum install -y openssl openssl-devel

  • 初始化成功的标志
Configuration summary
  + using system PCRE library
  + OpenSSL library is not used
  + using system zlib library