使用 PPA 重建带有额外模块的 Nginx

使用 PPA 重建带有额外模块的 Nginx

我正在尝试安装RTMP 模块在 Ubuntu 16.04.4 LTS 上。以下是我所做的...

add-apt-repository -y ppa:nginx/stable
vim /etc/apt/sources.list.d/nginx-ubuntu-stable-xenial.list
# Uncomment deb-src http://ppa.launchpad.net/nginx/stable/ubuntu xenial main
apt-get update

apt-get install dpkg-dev

mkdir /usr/src/nginx && cd /usr/src/nginx
apt-get source nginx
git clone https://github/arut/nginx-rtmp-module.git

cd nginx-1.12.2
vim debian/rules
# Added --add-module=/usr/src/nginx/nginx-rtmp-module to the full install flags

apt-get build-dep nginx
dpkg-buildpackage -b
cd ../
dpkg --install nginx-common_1.12.2-0+xenial0_all.deb nginx-full_1.12.2-0+xenial0_amd64.deb

但是,当尝试运行安装命令时,出现以下错误......

(Reading database ... 100580 files and directories currently installed.)
Preparing to unpack nginx-common_1.12.2-0+xenial0_all.deb ...
Unpacking nginx-common (1.12.2-0+xenial0) over (1.12.2-0+xenial0) ...
Preparing to unpack nginx-full_1.12.2-0+xenial0_amd64.deb ...
Unpacking nginx-full (1.12.2-0+xenial0) over (1.12.2-0+xenial0) ...
Setting up nginx-common (1.12.2-0+xenial0) ...
dpkg: dependency problems prevent configuration of nginx-full:
 nginx-full depends on libnginx-mod-http-auth-pam (= 1.12.2-0+xenial0); however:
  Package libnginx-mod-http-auth-pam is not installed.
 nginx-full depends on libnginx-mod-http-dav-ext (= 1.12.2-0+xenial0); however:
  Package libnginx-mod-http-dav-ext is not installed.
 nginx-full depends on libnginx-mod-http-echo (= 1.12.2-0+xenial0); however:
  Package libnginx-mod-http-echo is not installed.
 nginx-full depends on libnginx-mod-http-geoip (= 1.12.2-0+xenial0); however:
  Package libnginx-mod-http-geoip is not installed.
 nginx-full depends on libnginx-mod-http-image-filter (= 1.12.2-0+xenial0); however:
  Package libnginx-mod-http-image-filter is not installed.
 nginx-full depends on libnginx-mod-http-subs-filter (= 1.12.2-0+xenial0); however:
  Package libnginx-mod-http-subs-filter is not installed.
 nginx-full depends on libnginx-mod-http-upstream-fair (= 1.12.2-0+xenial0); however:
  Package libnginx-mod-http-upstream-fair is not installed.
 nginx
dpkg: error processing package nginx-full (--install):
 dependency problems - leaving unconfigured
Processing triggers for systemd (229-4ubuntu21.2) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Processing triggers for man-db (2.7.5-1) ...
Errors were encountered while processing:
 nginx-full

答案1

如果您使用 artful (17.10) 版本中的软件包,则会发生这种情况。/usr/lib/nginx/modules/*.so模块中的软件包被拆分出来,因此您可以逐个安装它们。这有一个不错的副作用,即您将拥有更高的自由度来选择要重新编译和安装的内容。

两个选项:

  • 使用您的 Ubuntu 版本支持的 nginx 版本(删除 PPA 版本并按照模块作者的说明进行操作,在该版本中,模块应全部位于 nginx-full 包中)
  • 使用较新的 nginx 包,但也要安装其分离出的依赖项(将它们添加到您的dpkg -i命令中 - 您可能已经生成了所需的包 - 检查包含的文件夹nginx-common_1.12*.deb

相关内容