【问题标题】:Installing Nginx安装 Nginx
【发布时间】:2013-01-31 07:46:55
【问题描述】:
./configure --user=boxflux 
            --group=boxflux 
            --prefix=/usr/local/nginx-1.3.0                    
            --with-pcre=/usr/lib64 
            --with-md5=/usr/lib64 
            --with-sha1=/usr/lib64 
            --with-zlib=/usr/lib64 
            --with-libatomic=/usr/lib64 
            --with-openssl=/usr/lib64 | grep 'not found'
checking for sys/filio.h ... not found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for F_READAHEAD ... not found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for dlopen() ... not found
checking for SO_SETFIB ... not found
checking for SO_ACCEPTFILTER ... not found
checking for setproctitle() ... not found
checking for POSIX semaphores ... not found
checking for struct dirent.d_namlen ... not found

我在安装 nginx 时遇到问题.. 我已经使用 'yum' 安装了 gcc、pcre*、zlib*、openssl*

我的配置有什么问题? 对了,我的电脑是64bit centos6,现在正在安装nginx 1.3.0(开发版)

--------- 添加 -----------

我忘了说它比我添加的那些 --with-*=DIR 更糟糕...... 当我运行 kolbyjack 给我的一行代码时,结果是..

./configure --user=boxflux --group=boxflux --prefix=/usr/local/nginx-1.3.0 |grep 'not found'
checking for sys/filio.h ... not found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for F_READAHEAD ... not found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for dlopen() ... not found
checking for SO_SETFIB ... not found
checking for SO_ACCEPTFILTER ... not found
checking for setproctitle() ... not found
checking for POSIX semaphores ... not found
checking for struct dirent.d_namlen ... not found
checking for PCRE JIT support ... not found
checking for system md library ... not found
checking for system md5 library ... not found
checking for sha1 in system md library ... not found

由于我是centos6的新手..我对这个问题真的没有任何想法.. 请帮帮我..

【问题讨论】:

  • 你为什么觉得你有问题?好的,您的系统中没有 kqueue。当然,你没有,因为你的系统不是 FreeBSD。
  • 感谢VBart~当我运行“sudo yum install kqueue”时,结果是“sudo yum install kqueue”我该如何安装kqueue在我的centos6上?请理解..因为我是centos的新手。
  • 你不能在 centos6 上安装 kqueue,因为它是一个 *BSD 内核特性。如果你想要 kqueue 支持,你选择了错误的操作系统。 NetBSD、OpenBSD、DragonflyBSD 和 Mac OS X 支持 kqueue,但 Linux 没有。或许,您可以使用 bsd 内核运行 centos,但这是个坏主意。 Nginx 不需要所有这些功能来运行。不同的操作系统有不同的特性,NGINX 只想知道你的系统支持哪些。
  • "... not found" 并不意味着坏或错误。在不同的系统上,您将有不同的“notfounds”。当您设置所有这些“--with-*=”时,您只是关闭了一些检查。
  • 真的非常感谢VBart..我刚刚发现它们不是你说的关键问题..ㅠㅠ..哇..顺便说一句,你真聪明!非常感谢 Bvart

标签: linux nginx yum


【解决方案1】:

很多时候,我宁愿不使用来自 src 的“售后”构建,而是使用本机 CentOS 软件包。

“PCRE Library Not Found”错误也可能是安装了pcre包而不是pcre-devel包时引起的。

只需“yum install pcre-devel”并重新运行 ./configure。

【讨论】:

    【解决方案2】:

    来自./configure --help

    --with-pcre=DIR                    set path to PCRE library sources
    --with-md5=DIR                     set path to md5 library sources
    --with-sha1=DIR                    set path to sha1 library sources
    --with-zlib=DIR                    set path to zlib library sources
    --with-libatomic=DIR               set path to libatomic_ops library sources
    --with-openssl=DIR                 set path to OpenSSL library sources
    

    如果您阅读帮助文本,这些选项中的每一个都设置了库sources 的目录,而不是库的安装版本。如果系统上已经安装了该库,nginx 应该在配置期间自动找到它。如果它安装在非标准位置,您应该使用--with-cc-opt--with-ld-opt 来设置 nginx 搜索的包含和库路径。由于您已经通过 yum 安装了所有库,我希望您真正需要的是:

    ./configure --user=boxflux --group=boxflux --prefix=/usr/local/nginx-1.3.0
    

    【讨论】: