centos 安装 nginx 遇到缺包问题

下载软件包,进入http://nginx.org/download/复制对应版本的下载链接地址

1.最新安装包下载

wget http://nginx.org/download/nginx-1.13.11.tar.gz

2.解压

tar zxf nginx-1.13.11.tar.gz

3.安装

./configure --prefix=/usr/local/nginx --with-http_dav_module --with-http_stub_status_module --with-http_addition_module --with-http_sub_module --with-http_flv_module --with-http_mp4_module --with-pcre --with-http_ssl_module --with-http_gzip_static_module --user=nginx --group=nginx

make && make install

如果遇到以下问题

编译安装nginx却requires the PCRE library编译安装nginx需要pcre包,未安装会有如下提示:

1.

./configure: error: the HTTP rewrite module requires the PCRE library.You can either disable the module by using --without-http_rewrite_moduleoption, or install the PCRE library into the system, or build the PCRE librarystatically from the source with nginx by using --with-pcre= option.

需要安装pcre的devel包,pcre-devel。使用yum安装即可:

yum -y install zlib zlib-devel

2.

./configure: error: SSL modules require the OpenSSL library.You can either do not enable the modules, or install the OpenSSL libraryinto the system, or build the OpenSSL library statically from the sourcewith nginx by using --with-openssl= option.

需要安装ssl包

yum -y install openssl openssl-devel  


启动 nginx 时提示如下错误时:

nginx: [emerg] getpwnam(“nobody”) failed

解决方案

在nginx.conf中 把user nobody的注释去掉,换成 root

user root;

worker_processes 4; #使用的cpu数

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容