Ubuntu Server Apache2 SSL виртуальный хост не работает

Я полностью настроил веб-сервер на Ubuntu с использованием SSL-шифрования. Я пытаюсь настроить файл -SSL по умолчанию, чтобы он указывал на правильные каталоги. geekychicgirls работает совершенно нормально, однако глазок всегда разрешает geekychicgirls, любая помощь приветствуется, см. код ниже.

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerAdmin webmaster@nixcraft.com
    DocumentRoot "/var/www/thepeepinghole"
    SSLEngine on
    SSLCertificateFile /ssl/14252798.crt
    SSLCertificateKeyFile /ssl/private.key
    SSLCertificateChainFile /ssl/futureretrogaming.ca-bundle
    ServerName www.thepeepinghole.tk
    ServerAlias thepeepinghole.tk
    ErrorLog "/var/www/thepeepinghole/log/error.log"
    CustomLog "/var/www/thepeepinghole/log/access.log" common
    <Directory /var/www/thepeepinghole>
                DirectoryIndex index.html
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
     </Directory>
</VirtualHost>

<VirtualHost *:443>
    ServerAdmin webmaster@nixcraft.com
    DocumentRoot "/var/www/geekychicgirls"
    SSLEngine on
    SSLCertificateFile /ssl/14252798.crt
    SSLCertificateKeyFile /ssl/private.key
    SSLCertificateChainFile /ssl/futureretrogaming.ca-bundle
    ServerName www.geekychicgirls.tk
    ServerAlias geekychicgirls.tk
    ErrorLog "/var/www/geekychicgirls/log/error.log"
    CustomLog "/var/www/geekychicgirls/log/access.log" common
    <Directory /var/www/geekychicgirls>
                DirectoryIndex index.html
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
     </Directory>
</VirtualHost>

</IfModule>
0
задан 16.05.2020, 23:59

2 ответа

Попытайтесь поместить

Редактирование NameVirtualHost *:443

<IfModule mod_ssl.c>
NameVirtualHost *:443
<VirtualHost *:443>
    ServerAdmin webmaster@nixcraft.com
    DocumentRoot "/var/www/thepeepinghole"
    SSLEngine on
...

1

, Только я могу сказать: теперь попробуйте что-то совершенно другое.

Редактирование/etc/apache2/ports.conf и добавляют следующую строку:

Listen 443

Также комментируют следующее в/etc/apache2/ports.conf:

 <IfModule mod_ssl.c>
    # SSL name based virtual hosts are not yet supported, therefore no
    # NameVirtualHost statement here
   Listen 443
</IfModule>

Создают файл, названный/etc/apache2/ssl.conf, и вставляют все из Вашего отправленного рассматриваемого файла без в начале и в конце.

<VirtualHost *:443>
    ServerAdmin webmaster@nixcraft.com
    DocumentRoot "/var/www/thepeepinghole"
    SSLEngine on
    SSLCertificateFile /ssl/14252798.crt
    SSLCertificateKeyFile /ssl/private.key
    SSLCertificateChainFile /ssl/futureretrogaming.ca-bundle
    ServerName www.thepeepinghole.tk
    ServerAlias thepeepinghole.tk
    ErrorLog "/var/www/thepeepinghole/log/error.log"
    CustomLog "/var/www/thepeepinghole/log/access.log" common
    <Directory /var/www/thepeepinghole>
                DirectoryIndex index.html
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
     </Directory>
</VirtualHost>

<VirtualHost *:443>
    ServerAdmin webmaster@nixcraft.com
    DocumentRoot "/var/www/geekychicgirls"
    SSLEngine on
    SSLCertificateFile /ssl/14252798.crt
    SSLCertificateKeyFile /ssl/private.key
    SSLCertificateChainFile /ssl/futureretrogaming.ca-bundle
    ServerName www.geekychicgirls.tk
    ServerAlias geekychicgirls.tk
    ErrorLog "/var/www/geekychicgirls/log/error.log"
    CustomLog "/var/www/geekychicgirls/log/access.log" common
    <Directory /var/www/geekychicgirls>
                DirectoryIndex index.html
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
     </Directory>
</VirtualHost>

Включают включать строку в/etc/apache2/apache2.conf:

Include "/etc/apache2/ssl.conf"

Перезапуск Apache2 с: перезапуск apache2ctl

0
ответ дан 16.05.2020, 23:59
  • 1
    Так или иначе I" m, все еще добираясь, ОШИБКА: Сайт thepeepinghole не существует! – Noah Herron 17.05.2020, 00:00
  • 2
    Привет, я попробовал то, что Вы упомянули, и это не зафиксировало его. – Long Ranger 17.05.2020, 00:00
  • 3
    попробуйте sudo a2ensite thepeepinghole.tk – Code Droid 17.05.2020, 00:00
  • 4
    Возможно, выгода на имя папки для сайта. Попробуйте sudo a2ensite thepeepinghole Widthout .tk – HCarrasko 17.05.2020, 00:01
  • 5
    Я получил эту ошибку в ответ: ОШИБКА: Сайт thepeepinghole.tk не существует! – yizzlez 17.05.2020, 00:01

Решение состояло в том, чтобы сначала удостовериться эти apache2.conf, включает sites-enabled папка а не sites-available папка.

Затем необходимо создать дополнительную символьную ссылку в Вашем sites-enabled папка, которая связывается с ssl файл по умолчанию, который Вы создали в sites-available папка. Наконец перезапустите apache2 сервис, и необходимо быть хорошими для движения.

1
ответ дан 17.05.2020, 00:00
  • 1
    Подсказка: Вы don' t должен вручную создать символьную ссылку. Можно использовать sudo a2ensite <your_site_file_name_in_sites-available> – Robi Kumar Tomar 17.05.2020, 00:00

Теги

Похожие вопросы