最后我决定将 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