Server 无法将SSL配置为httpd-vhosts.conf

Server 无法将SSL配置为httpd-vhosts.conf,server,lampp,Server,Lampp,我正在使用Ubuntu16.04服务器和lampp服务器,我发现这个错误XAMPP:Your/etc/hosts不正常。我会解决它。当我取消注释这一行时 到目前为止,它在端口80中运行良好。我想向它添加SSL 请帮帮我 我的httpd vhosts.conf文件 <VirtualHost 127.0.0.4:443> DocumentRoot "/opt/lampp/htdocs/example.com/public" ServerName example.com Dir

我正在使用Ubuntu16.04服务器和lampp服务器,我发现这个错误
XAMPP:Your/etc/hosts不正常。我会解决它。
当我取消注释这一行时

到目前为止,它在端口80中运行良好。我想向它添加SSL

请帮帮我

我的
httpd vhosts.conf
文件

<VirtualHost 127.0.0.4:443>
  DocumentRoot "/opt/lampp/htdocs/example.com/public"
  ServerName example.com
  DirectoryIndex index.php

  #SSLEngine on
  #SSLCertificateFile /etc/letsencrypt/live/example.com/privkey.pem
  #SSLCertificateKeyFile /etc/letsencrypt/live/example.com/cert.pem
  #SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem
  <Directory "/opt/lampp/htdocs/example.com/public">
        Options All
        AllowOverride All
        Require all granted
  </Directory>
</VirtualHost>
127.0.0.1       localhost
127.0.0.4       example.com

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
取消注释
#SSLEngine on

XAMPP:  Starting diagnose... 
XAMPP: Your /etc/hosts is not okay. I will fix it.
XAMPP:  Next try...

原因是我在
SSLCertificateFile
cert.pem
中提供了
privkey.pem

#SSLCertificateFile /etc/letsencrypt/live/example.com/privkey.pem
#SSLCertificateKeyFile /etc/letsencrypt/live/example.com/cert.pem
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
更改为此后,它运行良好&无需
SSLCertificateChainFile

#SSLCertificateFile /etc/letsencrypt/live/example.com/privkey.pem
#SSLCertificateKeyFile /etc/letsencrypt/live/example.com/cert.pem
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem