我想为我的网站提供 HTTPS 连接,因此我创建了一个 SSL 证书。当我尝试重新启动 Apache2 时,它会抛出此错误:
Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
这是我的配置(在 /etc/apache2/sites-enabled 中)
<VirtualHost *:443>
ServerAdmin [email protected]
DocumentRoot /var/www/html
SSLEngine on
SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
SSLCertificateFile /etc/ssl/private/apache-selfsigned.key
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
我该如何修复它?
答案1
请加
ServerName example.com
在 web 服务器 conf 上并尝试重新加载 web 服务器。