Linux 安装 Nginx

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10897309/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 06:39:43  来源:igfitidea点击:

Installing Nginx

linuxnginxyum

提问by Anderson

./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

I have a problem installing nginx.. I've already installed gcc, pcre*, zlib*, openssl* by using 'yum'

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

What's problem with my configuration? By the way, my computer is 64bit centos6 and I'm now installing nginx 1.3.0 (development version)

我的配置有什么问题?顺便说一句,我的电脑是64位centos6,我现在安装的是nginx 1.3.0(开发版)

--------- ADDITOIN -----------------------

--------- 添加剂 ---------------

I forgot to mention that it was even worse than I added those --with-*=DIR... When I run a line of code kolbyHyman gave me, the result is..

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

./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

Since I am a newbie on centos6.. I really have no any idea on this issue.. please help me..

由于我是centos6的新手..我真的对这个问题一无所知..请帮助我..

采纳答案by kolbyHyman

From ./configure --help:

来自./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

If you read the help text, each of those options set the directory for the library sources, not the installed version of the library. If the library is already installed on the system, nginx should automatically find it during configure. If it's installed in a nonstandard location, you should use --with-cc-optand --with-ld-optto set the include and library paths for nginx to search. Since you've installed all the libs via yum, I expect that all you really need is:

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

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

回答by mrfileio

Often times, I'd prefer not to use "after market" builds from src but instead use the native CentOS packages.

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

The "PCRE Library Not Found" error can also be caused when the pcre package is installed but not the pcre-devel package.

当安装了 pcre 包但未安装 pcre-devel 包时,也可能导致“PCRE Library Not Found”错误。

Merely, 'yum install pcre-devel' and rerun ./configure.

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