为什么Apache提供新证书和过期证书?
由于这是一个敏感的客户端项目,我所说的域名的所有用途都被“example.com”取代 我正在管理一个公共网站,其Let's Encrypt证书最近过期。因此,我遵循DigitalOcean教程,使用为什么Apache提供新证书和过期证书?,apache,ssl,https,ubuntu-14.04,lets-encrypt,Apache,Ssl,Https,Ubuntu 14.04,Lets Encrypt,由于这是一个敏感的客户端项目,我所说的域名的所有用途都被“example.com”取代 我正在管理一个公共网站,其Let's Encrypt证书最近过期。因此,我遵循DigitalOcean教程,使用certbot自动续订来续订证书(是的,之后我运行了sudo service apache2重新加载)。它成功了,但问题是该站点现在同时提供新证书和过期证书,而且似乎发生了随机选择。有时浏览器会信任该站点,因为它会收到新的证书,而有时浏览器会拒绝过期的证书。即使通过测试运行站点,有时也会得到A级,有
certbot自动续订
来续订证书(是的,之后我运行了sudo service apache2重新加载
)。它成功了,但问题是该站点现在同时提供新证书和过期证书,而且似乎发生了随机选择。有时浏览器会信任该站点,因为它会收到新的证书,而有时浏览器会拒绝过期的证书。即使通过测试运行站点,有时也会得到A级,有时则会失败
当我的配置仅显式包含新的证书时,是什么原因导致这两个证书继续被使用?我很困惑
立即运行certbot auto-renew
会得到以下结果:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
-------------------------------------------------------------------------------
Processing /etc/letsencrypt/renewal/example.com.conf
-------------------------------------------------------------------------------
Cert not yet due for renewal
The following certs are not due for renewal yet:
/etc/letsencrypt/live/example.com/fullchain.pem (skipped)
No renewals were attempted
Apache的站点启用目录如下所示:
000-default.conf 000-default-le-ssl.conf
并且每个的配置如下所示:
000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
服务器管理员webmaster@localhost
DocumentRoot/var/www/html
选项索引跟随符号链接
允许超越所有
要求所有授权
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
重新启动发动机
RewriteCond%{SERVER_NAME}=example.com
重写规则^https://%{SERVER_NAME}%{REQUEST_URI}[END,NE,R=permanent]
000-default-le-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
ServerName example.com
</VirtualHost>
</IfModule>
服务器管理员webmaster@localhost
DocumentRoot/var/www/html
选项索引跟随符号链接
允许超越所有
要求所有授权
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
SSLCertificateFile/etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile/etc/letsencrypt/live/example.com/privkey.pem
Include/etc/letsencrypt/options-ssl-apache.conf
ServerName example.com
我可以通过调用sudo服务apache2 stop
来停止apache,然后运行ps aux | grep apache
来解决这个问题。我发现有多个apache实例正在运行。所以我杀了他们,重新启动了apache,现在一切正常。你每3个月做一次,还是有更好的解决方案?