CentOS 7 httpd 模組遺失

CentOS 7 httpd 模組遺失

最後我決定將 CentOS 5 遷移到 7,但我無法從 yum 或伺服器內取得 httpd 模組。

我讀到我們不能盲目地使用apache 2.2配置2.4,模組名稱可能會被更改或刪除。我如何知道它變成了什麼?

如何從 yum 取得模組? yum whatprovides mod_authz_default.so 不回傳任何套件。

我一直一條評論出來,它會列出下一條。是的,/usr/lib64/httpd/modules 中有模組,但不是舊 httpd.conf 需要的模組。

Mar 01 16:25:01 myhost httpd[19931]: httpd: Syntax error on line 164 of /etc/httpd/conf/httpd.conf: Cannot load modules/mod_authn_default.so into server: /etc/httpd/modules/mod_authn_default.so: cannot open shared object file: No such file or directory
Mar 01 16:25:01 myhost systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Mar 01 16:25:01 myhost kill[19933]: kill: cannot find process ""
Mar 01 16:25:01 myhost systemd[1]: httpd.service: control process exited, code=exited status=1
Mar 01 16:25:01 myhost systemd[1]: Failed to start The Apache HTTP Server.
Mar 01 16:25:01 myhost systemd[1]: Unit httpd.service entered failed state.
Mar 01 16:25:01 myhost systemd[1]: httpd.service failed.
Mar 01 16:39:25 myhost systemd[1]: Starting The Apache HTTP Server...
Mar 01 16:39:25 myhost httpd[20172]: httpd: Syntax error on line 170 of /etc/httpd/conf/httpd.conf: Cannot load modules/mod_authz_default.so into server: /etc/httpd/modules/mod_authz_default.so: cannot open shared object file: No such file or directory
Mar 01 16:39:25 myhost systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Mar 01 16:39:25 myhost kill[20174]: kill: cannot find process ""
Mar 01 16:39:25 myhost systemd[1]: httpd.service: control process exited, code=exited status=1
Mar 01 16:39:25 myhost systemd[1]: Failed to start The Apache HTTP Server.
Mar 01 16:39:25 myhost systemd[1]: Unit httpd.service entered failed state.
Mar 01 16:39:25 myhost systemd[1]: httpd.service failed.
Mar 01 16:41:29 myhost systemd[1]: Starting The Apache HTTP Server...
Mar 01 16:41:29 myhost httpd[20195]: httpd: Syntax error on line 185 of /etc/httpd/conf/httpd.conf: Cannot load modules/mod_ident.so into server: /etc/httpd/modules/mod_ident.so: cannot open shared object file: No such file or directory
Mar 01 16:41:29 myhost systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Mar 01 16:41:29 myhost kill[20197]: kill: cannot find process ""
Mar 01 16:41:29 myhost systemd[1]: httpd.service: control process exited, code=exited status=1
Mar 01 16:41:29 myhost systemd[1]: Failed to start The Apache HTTP Server.
Mar 01 16:41:29 myhost systemd[1]: Unit httpd.service entered failed state.
Mar 01 16:41:29 myhost systemd[1]: httpd.service failed.

答案1

apache 2.4似乎這些模組已從:mod_authn_default、mod_authz_default、mod_mem_cache中刪除。參考apache升級文檔

對於mod_ident.c其他模組,我從 GitHub 下載了原始程式碼並編譯了它。

例子:

[root@myhost ~]# wget https://raw.githubusercontent.com/omnigroup/Apache/master/httpd/modules/metadata/mod_ident.c

[root@myhost ~]# apxs -a -i -c  mod_ident.c

答案2

您可以在伺服器centos 7 mod_cache_disk而不是mod_disk_cache上搜尋。正如您在此圖片連結中看到的:https://prnt.sc/10jpipm

相關內容