安装libapache2-mod-rpaf以使用nginx作为反向代理检测IP时出错

时间:2014-10-01 11:01:07

标签: apache nginx proxy

我见过here,我应该安装mod_rpaf,以便Apache能够检测来自Nginx反向代理的IP。

即使看到Ununtu SO上存在错误,也应该更改/etc/apache2/mods-available/rpaf.conf上的第一行。

第一行包含<IfModule rpaf_module>。我尝试用<IfModule mod_rpaf-2.0.c>替换,但是当我重新启动Apache时没有任何改变。

这是我尝试安装此模块时的输出:

apt-get install libapache2-mod-rpaf 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  libapache2-mod-rpaf
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/9,126 B of archives.
After this operation, 67.6 kB of additional disk space will be used.
Selecting previously unselected package libapache2-mod-rpaf.
(Reading database ... 28714 files and directories currently installed.)
Unpacking libapache2-mod-rpaf (from .../libapache2-mod-rpaf_0.6-2ubuntu1_amd64.deb) ...
Setting up libapache2-mod-rpaf (0.6-2ubuntu1) ...
Enabling module rpaf.
 * Restarting web server apache2                                         [fail] 
 * The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/rpaf.load: API module structure 'rpaf_module' in file /usr/lib/apache2/modules/mod_rpaf.so is garbled - expected signature 41503234 but saw 41503232 - perhaps this is not an Apache module DSO, or was compiled for a different Apache version?
Action 'configtest' failed.
The Apache error log may have more information.
invoke-rc.d: initscript apache2, action "restart" failed.
dpkg: error processing libapache2-mod-rpaf (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 libapache2-mod-rpaf
E: Sub-process /usr/bin/dpkg returned an error code (1)

1 个答案:

答案 0 :(得分:3)

根据错误,您的系统上已经有一个/usr/lib/apache2/modules/mod_rpaf.so版本,其文件大小与软件包配置的预期不同(预期签名为41503234,但是看到了41503232),所以你需要:

1)找出安装了冲突版本的内容并将其卸载:

dpkg -S /usr/lib/apache2/modules/mod_rpaf.so
apt-get --purge remove <package>

或者如果手动添加:

mv /usr/lib/apache2/modules/mod_rpaf.so /usr/lib/apache2/modules/mod_rpaf.so.bak
apt-get install libapache2-mod-rpaf 

这可能会破坏其他东西。

2)手动下载re-compile and install from source,应解决当前问题,但如果您尝试通过apt更新,则会遇到相同的冲突签名问题。

3)Unpack the deb file, hack the hash in the config, repackage and install.