将其放在其他 LoadModule 指令之后

将其放在其他 LoadModule 指令之后

我已启用当前代理模块并且运行良好:

$ apache2ctl -M | grep proxy
 proxy_module (shared)
 proxy_fcgi_module (shared)

当我使用mod_proxy_httpa2enmod proxy_http启用时service apache2 restart,apache 返回一个错误,好像 mod_proxy 未启用:

10 月 16 日 10:55:45 apachectl[15243]: apache2: /etc/apache2/apache2.conf 第 140 行语法错误: /etc/apache2/mods-enabled/proxy_http.load 第 2 行语法错误: 无法将 /usr/lib/apache2/modules/mod_proxy_http.so 加载到服务器: /usr/lib/apache2/modules/mod_proxy_http.so: 未定义符号: ap_proxy_check_connection

ap_proxy_check_connection是一个 mod_proxy.h 方法https://ci.apache.org/projects/httpd/trunk/doxygen/group__MOD__PROXY.html#ga618c0e1bede21bdd3af5d6a802671cae

模块顺序加载可能存在问题?

谢谢。

更新:在指令前添加 LoadModule mod_proxy 后IncludeOptional,问题依然存在。

$ vi /etc/apache2/apache2.conf

Include /etc/apache2/mods-available/proxy.load
Include /etc/apache2/mods-available/proxy.conf

# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

$ apache2ctl -M | grep proxy

[Mon Oct 16 11:14:00.205439 2017] [so:warn] [pid 19944] AH01574: module proxy_module is already loaded, skipping
 proxy_module (shared)
 proxy_fcgi_module (shared)

$ a2enmod proxy_http

Considering dependency proxy for proxy_http:
Module proxy already enabled
Enabling module proxy_http.
To activate the new configuration, you need to run:
  systemctl restart apache2

$ apache2ctl -M | grep proxy

[Mon Oct 16 11:14:11.256292 2017] [so:warn] [pid 20006] AH01574: module proxy_module is already loaded, skipping
apache2: Syntax error on line 142 of /etc/apache2/apache2.conf: Syntax error on line 2 of /etc/apache2/mods-enabled/proxy_http.load: Cannot load /usr/lib/apache2/modules/mod_proxy_http.so into server: /usr/lib/apache2/modules/mod_proxy_http.so: undefined symbol: ap_proxy_check_connection

答案1

这可能是由于dist-upgrade。请查看 Plesk 支持文章-

将其放在其他 LoadModule 指令之后

LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

答案2

听起来像问题描述的那样这里。 修理:

apt-get purge libapache2-mod-proxy-psa
a2dismod proxy
a2enmod proxy proxy_fcgi
systemctl restart apache2

相关内容