Использование HTTPS на сервере Apache победило ' t work

Для моего сервера www.tripmatcher, com, У меня та же проблема, что и у . Почему apache httpd сообщает мне, что мои виртуальные хосты на основе имен работают только с браузерами с поддержкой SNI (RFC 4366) . Мой файл конфигурации находится в /etc/apache2/sites-enabled/default-ssl.conf и выглядит так:

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerName tripmatcher.com
        RewriteEngine on
        RewriteCond %{HTTP_HOST} ^tripmatcher.com
        RewriteRule ^/(.*)$ http://www.tripmatcher.com/$1 [L,R=301]

        ServerAdmin admin@tripmatcher.com
        DocumentRoot /var/www/html
        <Directory "/var/www/html">
        AllowOverride All
        </Directory>

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
       # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example # the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

<VirtualHost *:443>

ServerAdmin admin@tripmatcher.com

DocumentRoot /var/www/html
<Directory "/var/www/html">
        AllowOverride All
        </Directory>


ServerName tripmatcher.com

ErrorLog ${APACHE_LOG_DIR}/error.log

SSLEngine on

SSLCertificateFile /etc/ssl/tripmatcher.crt

SSLCertificateKeyFile /etc/ssl/tripmatcher.key

SSLCertificateChainFile /etc/ssl/tripmatcher.ca-bundle

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Насколько я понимаю, все выглядит нормально. Может ли кто-нибудь указать мне, что происходит не так? Проблема в том, что когда я перехожу на https://www.tripmatcher.com , я получаю загрузку страницы, хотя и с некоторым отсутствием CSS. Однако, когда я вхожу в систему и перехожу, скажем, на https://tripmatcher.com/matcher , я получаю «Запрошенный URL / сопоставитель не найден на этом сервере». Не могли бы вы объяснить мне, что происходит не так?

Мой файл конфигурации находится в /etc/apache2/sites-enabled/default-ssl.conf и выглядит так:

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerName tripmatcher.com
        RewriteEngine on
        RewriteCond %{HTTP_HOST} ^tripmatcher.com
        RewriteRule ^/(.*)$ http://www.tripmatcher.com/$1 [L,R=301]

        ServerAdmin admin@tripmatcher.com
        DocumentRoot /var/www/html
        <Directory "/var/www/html">
        AllowOverride All
        </Directory>

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
       # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example # the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

<VirtualHost *:443>

ServerAdmin admin@tripmatcher.com

DocumentRoot /var/www/html
<Directory "/var/www/html">
        AllowOverride All
        </Directory>


ServerName tripmatcher.com

ErrorLog ${APACHE_LOG_DIR}/error.log

SSLEngine on

SSLCertificateFile /etc/ssl/tripmatcher.crt

SSLCertificateKeyFile /etc/ssl/tripmatcher.key

SSLCertificateChainFile /etc/ssl/tripmatcher.ca-bundle

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Насколько я понимаю, все выглядит нормально. Может ли кто-нибудь указать мне, что происходит не так? Проблема в том, что когда я перехожу на https://www.tripmatcher.com , я получаю загрузку страницы, хотя и с некоторым отсутствием CSS. Однако, когда я вхожу в систему и перехожу, скажем, на https://tripmatcher.com/matcher , я получаю «Запрошенный URL / сопоставитель не найден на этом сервере». Не могли бы вы объяснить мне, что происходит не так?

Мой файл конфигурации находится в /etc/apache2/sites-enabled/default-ssl.conf и выглядит так:

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerName tripmatcher.com
        RewriteEngine on
        RewriteCond %{HTTP_HOST} ^tripmatcher.com
        RewriteRule ^/(.*)$ http://www.tripmatcher.com/$1 [L,R=301]

        ServerAdmin admin@tripmatcher.com
        DocumentRoot /var/www/html
        <Directory "/var/www/html">
        AllowOverride All
        </Directory>

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
       # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example # the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

<VirtualHost *:443>

ServerAdmin admin@tripmatcher.com

DocumentRoot /var/www/html
<Directory "/var/www/html">
        AllowOverride All
        </Directory>


ServerName tripmatcher.com

ErrorLog ${APACHE_LOG_DIR}/error.log

SSLEngine on

SSLCertificateFile /etc/ssl/tripmatcher.crt

SSLCertificateKeyFile /etc/ssl/tripmatcher.key

SSLCertificateChainFile /etc/ssl/tripmatcher.ca-bundle

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Насколько я понимаю, все выглядит нормально. Может ли кто-нибудь указать мне, что происходит не так? Проблема в том, что когда я перехожу на https://www.tripmatcher.com , я получаю загрузку страницы, хотя и с некоторым отсутствием CSS. Однако, когда я вхожу в систему и захожу, скажем, на https://tripmatcher.com/matcher , я получаю «Запрошенный URL / сопоставитель не найден на этом сервере». Не могли бы вы объяснить мне, что происходит не так?

когда я вхожу в систему и захожу, скажем, на https://tripmatcher.com/matcher , я получаю «Запрошенный URL / сопоставитель не найден на этом сервере». Не могли бы вы объяснить мне, что происходит не так?

когда я вхожу в систему и захожу, скажем, на https://tripmatcher.com/matcher , я получаю «Запрошенный URL / сопоставитель не найден на этом сервере». Не могли бы вы объяснить мне, что происходит не так?

[Вс, 10 декабря, 22:23: 25.578086 2017] [ssl: warn] [pid 19647] AH02292: Init: виртуальные хосты SSL на основе имени работают только для клиентов с поддержкой указания имени сервера TLS (RFC 4366) [Вс, 10 декабря, 22:23: 25.580546 2017] [mpm_prefork: notice] [pid 19647] AH00163: Apache / 2.4.7 (Ubuntu) PHP / 5.5.9-1ubuntu4.20 Настроен OpenSSL / 1.0.1f - возобновление нормальной работы [Вс, 10 декабря, 22:23: 25.580590, 2017] [core: notice] [pid 19647] AH00094: Командная строка: '/ usr / sbin / apache2'

Я вижу это в журналах.

0
задан 11 December 2017 в 00:23
1 ответ

RewriteEngine On RewriteCond% {SERVER_PORT} 80 RewriteRule ^ (. *) $ https://www.tripmatcher.com/index.php/ $ 1 [R, L]

RewriteRule

Просто замените верхнюю часть моего .htaccess на это сделали свое дело. Надеюсь, это будет полезно для всех, у кого есть эта проблема.

0
ответ дан 5 December 2019 в 07:02

Теги

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