Невозможно настроить SSL для httpd-vhosts.conf - PullRequest
0 голосов
/ 14 января 2020

Я использую сервер Ubuntu 16.04 и сервер lampp и получаю эту ошибку XAMPP: Your /etc/hosts is not okay. I will fix it., когда я раскомментирую эту строку #SSLEngine on

Пока все работает нормально в порту 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>

Мой /etc/hosts файл

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...

1 Ответ

0 голосов
/ 17 января 2020

Причина в том, что я предоставил privkey.pem в SSLCertificateFile & cert.pem в SSLCertificateKeyFile

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

После перехода на это все работало нормально и не нужно SSLCertificateChainFile

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