我已经在测试服务器上的 teampass 网站上配置了 SSL。我没有看到 https://teampass.domain.org 中的“s”

我已经在测试服务器上的 teampass 网站上配置了 SSL。我没有看到 https://teampass.domain.org 中的“s”

当我尝试访问时,我可以访问该网站,但我没有看到 https:// 中的“S”

我做了我的

  1. apachectl 配置测试

  2. apachectl 停止

  3. apachectl 启动

  4. a2ensite 默认-ssl.conf

  5. a2ensite teampass.conf

  6. /etc/init.d/apache2 重新启动

我在以下位置配置了我的虚拟主机/etc/apache2/sites-available/default-ssl.conf

<VirtualHost *:443>
        ServerAdmin webmaster@localhost
        ServerName teampass.domain.org
        Serveralias www.teampass.domain.org
        DocumentRoot /var/www/html/teampass

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

        SSLCACertificateFile /etc/apache2/ssl/DigiCertCA
        SSLCertificateFile /etc/apache2/ssl/star_domain_org
        SSLCertificateKeyfile /etc/apache2/ssl/teampass.key
</VirtualHost>

这是我的 /etc/apache2/sites-available/teampass.conf

<VirtualHost *:80>
    Redirect permanent / https://teampass.domain.org/
    ServerAdmin webmaster@localhost
    ServerName teampass.domain.org
    ServerAlias www.teampass.domain.org
    DocumentRoot /var/www/html/teampass
    <Directory /var/www/html/teampass>
            AllowOverride All
    </Directory>

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

    SSLEngine on
    SSLCACertificateFile /etc/apache2/ssl/DigiCertCA
    SSLCertificateFile /etc/apache2/ssl/star_domain_org
    SSLCertificateKeyfile /etc/apache2/ssl/teampass.key
</VirtualHost>


<VirtualHost *:443>
        ServerAdmin webmaster@localhost
        ServerName teampass
        ServerAlias www.teampass.domain.org
        DocumentRoot /var/www/html/teampass

        SSLCertificateFile /etc/apache2/ssl/star_domain_org
        SSLCertificateKeyfile /etc/apache2/ssl/teampass.key
        SSLCACertificateFile /etc/apache2/ssl/DigiCertCA
        SSLEngine on
        ErrorLog ${APACHE_LOG_DIR}/teampass_error.log
        CustomLog ${APACHE_LOG_DIR}/teampass_access.log combined

        <IfModule mod_rewrite.c>
                # DO NOT REMOVE
                RewriteOptions Inherit
        </IfModule>
</VirtualHost>

这是我的 /etc/apache2/ports.conf

Listen 80
<IfModule ssl_module>
        Listen 443 http
</IfModule>

<IfModule mod_gnutls.c>
        listen 443 http
</IfModule>

答案1

在您的 port.conf 中更改

Listen 80
<IfModule ssl_module>
        Listen 443 http
</IfModule>

<IfModule mod_gnutls.c>
        listen 443 http
</IfModule>

经过

Listen 80
<IfModule ssl_module>
        Listen 443
</IfModule>

默认 443 已经是https如果你设置http之后,它将http在端口 443 上提供服务器内容

这是您需要的配置:

/etc/apache2/sites-available/default-ssl.conf:

<VirtualHost *:443>
        ServerAdmin webmaster@localhost
        ServerName teampass.domain.org
        Serveralias www.teampass.domain.org
        DocumentRoot /var/www/html/teampass

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

        SSLCACertificateFile /etc/apache2/ssl/DigiCertCA
        SSLCertificateFile /etc/apache2/ssl/star_domain_org
        SSLCertificateKeyfile /etc/apache2/ssl/teampass.key
</VirtualHost>

/etc/apache2/sites-available/teampass.conf

<VirtualHost *:80>
    Redirect permanent / https://teampass.domain.org/
    ServerAdmin webmaster@localhost
    ServerName teampass.domain.org
    ServerAlias www.teampass.domain.org
    DocumentRoot /var/www/html/teampass
    <Directory /var/www/html/teampass>
            AllowOverride All
    </Directory>

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


<VirtualHost *:443>
        ServerAdmin webmaster@localhost
        ServerName teampass
        ServerAlias www.teampass.domain.org
        DocumentRoot /var/www/html/teampass

        SSLCertificateFile /etc/apache2/ssl/star_domain_org
        SSLCertificateKeyfile /etc/apache2/ssl/teampass.key
        SSLCACertificateFile /etc/apache2/ssl/DigiCertCA
        SSLEngine on
        ErrorLog ${APACHE_LOG_DIR}/teampass_error.log
        CustomLog ${APACHE_LOG_DIR}/teampass_access.log combined

        <IfModule mod_rewrite.c>
                # DO NOT REMOVE
                RewriteOptions Inherit
        </IfModule>
</VirtualHost>

相关内容