如何在CentOS 9上使用Let's Encrypt保护Apache?

fv2wmkja  于 2022-11-07  发布在  Apache
关注(0)|答案(2)|浏览(189)

我找不到一种方法来为运行在Centos 9和Apache服务器(版本:第2.4.51节)中所述。
我试着跟随this tutorial,但是我搜索过的所有软件包管理器(yum,snap & dnf)都没有所需的python3-certbot-apache软件包,也没有任何python*-certbot-apache软件包(当然,turorial是为Centos 8准备的,但是我找不到任何关于保护Centos 9的参考资料)。
任何形式的帮助都将不胜感激。
哦,以防万一这可能对聪明人有价值的信息,下面是我尝试运行sudo certbot --apache时得到的错误日志:

2022-04-01 15:54:42,360:DEBUG:urllib3.connectionpool:http://localhost:None "GET /v2/connections?snap=certbot&interface=content HTTP/1.1" 200 97
2022-04-01 15:54:42,830:DEBUG:certbot._internal.main:certbot version: 1.25.0 
2022-04-01 15:54:42,831:DEBUG:certbot._internal.main:Location of certbot entry point: /snap/certbot/1888/bin/certbot 
2022-04-01 15:54:42,831:DEBUG:certbot._internal.main:Arguments: ['--apache', '--preconfigured-renewal'] 
2022-04-01 15:54:42,831:DEBUG:certbot._internal.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#apache,PluginEntryPoint#manual,PluginEntryPoint#nginx,PluginEntryPoint#null,PluginEntryPoint#standalone,PluginEntryPoint#webroot) 
2022-04-01 15:54:42,846:DEBUG:certbot._internal.log:Root logging level set at 30 
2022-04-01 15:54:42,847:DEBUG:certbot._internal.plugins.selection:Requested authenticator apache and installer apache 
2022-04-01 15:54:42,943:DEBUG:certbot_apache._internal.configurator:Apache version is 2.4.51 
2022-04-01 15:54:42,986:WARNING:certbot_apache._internal.apache_util:Error in checking parameter list: 
2022-04-01 15:54:42,986:DEBUG:certbot._internal.plugins.disco:Misconfigured PluginEntryPoint#apache: Apache is unable to check whether or not the module is loaded because Apache is misconfigured. Traceback (most recent call last):
   File "/var/lib/snapd/snap/certbot/1888/lib/python3.8/site-packages/certbot/_internal/plugins/disco.py", line 160, in prepare     self._initialized.prepare()
   File "/var/lib/snapd/snap/certbot/1888/lib/python3.8/site-packages/certbot_apache/_internal/configurator.py", line 368, in prepare     self.parser = self.get_parser()
   File "/var/lib/snapd/snap/certbot/1888/lib/python3.8/site-packages/certbot_apache/_internal/override_centos.py", line 79, in get_parser     return CentOSParser(
   File "/var/lib/snapd/snap/certbot/1888/lib/python3.8/site-packages/certbot_apache/_internal/override_centos.py", line 164, in __init__     super().__init__(*args,**kwargs)
   File "/var/lib/snapd/snap/certbot/1888/lib/python3.8/site-packages/certbot_apache/_internal/parser.py", line 79, in __init__     self.update_runtime_variables()
   File "/var/lib/snapd/snap/certbot/1888/lib/python3.8/site-packages/certbot_apache/_internal/override_centos.py", line 169, in update_runtime_variables     super().update_runtime_variables()
   File "/var/lib/snapd/snap/certbot/1888/lib/python3.8/site-packages/certbot_apache/_internal/parser.py", line 299, in update_runtime_variables     self.update_defines()
   File "/var/lib/snapd/snap/certbot/1888/lib/python3.8/site-packages/certbot_apache/_internal/parser.py", line 305, in update_defines     self.variables = apache_util.parse_defines(self.configurator.options.ctl)   File "/var/lib/snapd/snap/certbot/1888/lib/python3.8/site-packages/certbot_apache/_internal/apache_util.py", line 153, in parse_defines     matches = parse_from_subprocess(define_cmd, r"Define: ([^ \n]*)")
   File "/var/lib/snapd/snap/certbot/1888/lib/python3.8/site-packages/certbot_apache/_internal/apache_util.py", line 208, in parse_from_subprocess     stdout = _get_runtime_cfg(command)
   File "/var/lib/snapd/snap/certbot/1888/lib/python3.8/site-packages/certbot_apache/_internal/apache_util.py", line 241, in _get_runtime_cfg     raise errors.MisconfigurationError( certbot.errors.MisconfigurationError: Apache is unable to check whether or not the module is loaded because Apache is misconfigured. 
2022-04-01 15:54:42,988:DEBUG:certbot._internal.plugins.selection:Single candidate plugin: * apache Description: Apache Web Server plugin Interfaces: Installer, Authenticator, Plugin Entry point: apache = certbot_apache._internal.entrypoint:ENTRYPOINT Initialized:  Prep: Apache is unable to check whether or not the module is loaded because Apache is misconfigured. 
2022-04-01 15:54:42,989:DEBUG:certbot._internal.plugins.selection:Selected authenticator None and installer None
wtlkbnrh

wtlkbnrh1#

只是以防有人面临同样的问题,在我发布的时候,Centos 9上没有certbot的支持,因此没有解决我所面临的问题。在我的情况下,我有一个不同的centos版本的奢侈品,所以我就这样做了。

xxe27gdn

xxe27gdn2#

您可以从EPEL存储库中使用Certbot,但是CentOS9上Apache中apachectl不能满足Certbot的要求。您必须注解掉一个异常,如www.example.com中所述https://github.com/certbot/certbot/issues/8945#issuecomment-1185054399
不幸的是,EPEL上的Certbot没有打补丁,你必须在每次升级Certbot后打补丁。它在我的几个CentOS 9主机上工作得很好。

相关问题