繁体   English   中英

如何在centos 7中为http / 2添加加密证书?

[英]How to add lets encrypt certificate in centos 7 for http/2?

我已按照以下链接在centos-7 apache中启用http / 2。 https://www.tunetheweb.com/performance/http2/

Apache版本: 2.4.27

我的openssl版本:

# openssl version
OpenSSL 1.1.0f  25 May 2017

我需要向该域添加https证书,以在浏览器中检查http / 2进程。

当我尝试使用添加证书时,将其加密为:

#sudo  certbot --apache
We were unable to find a vhost with a ServerName or Address of xxx.yyy.com.
Which virtual host would you like to choose?
(note: conf files with multiple vhosts are not yet supported)
-------------------------------------------------------------------------------
1: ssl.conf                       |                       | HTTPS | Enabled
-------------------------------------------------------------------------------
Press 1 [enter] to confirm the selection (press 'c' to cancel): 1
Error while running apachectl graceful.
Job for httpd.service invalid.
Cleaning up challenges
Error while running apachectl graceful.
Job for httpd.service invalid.
Encountered exception during recovery
Error while running apachectl graceful.
Job for httpd.service invalid.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/certbot/error_handler.py", line 99, in _call_registered
    self.funcs[-1]()
  File "/usr/lib/python2.7/site-packages/certbot/auth_handler.py", line 284, in _cleanup_challenges
    self.auth.cleanup(achalls)
  File "/usr/lib/python2.7/site-packages/certbot_apache/configurator.py", line 1908, in cleanup
    self.restart()
  File "/usr/lib/python2.7/site-packages/certbot_apache/configurator.py", line 1797, in restart
    self._reload()
  File "/usr/lib/python2.7/site-packages/certbot_apache/configurator.py", line 1808, in _reload
    raise errors.MisconfigurationError(str(err))
MisconfigurationError: Error while running apachectl graceful.
Job for httpd.service invalid.
Error while running apachectl graceful.
Job for httpd.service invalid.

在遵循let加密证书添加过程的同时,

 #yum install certbot-apache

Installing:
 python2-certbot-apache                           noarch                           0.14.1-1.el7                                        epel                              144 k
Installing for dependencies:
 httpd                                            x86_64                           2.4.6-45.el7.centos.4                               updates                           2.7 M
 mod_ssl                                          x86_64                           1:2.4.6-45.el7.centos.4                             updates                           105 k

它正在添加这些软件包。 因此服务器中同时存在http-2.4.6和2.4.27。

我想我可以使您更进一步。 尝试这个:

certbot --authenticator standalone --installer apache --pre-hook "systemctl stop httpd" --post-hook "systemctl start httpd"

另外,在尝试以上操作之前,请检查apache的状态... systemctl status httpd 如果它关闭并且无法启动,请找到僵尸线程( ps -ef|grep httpd )并杀死它们。 (或重新启动)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM