具有通配符证书的 apache2 虚拟目录

具有通配符证书的 apache2 虚拟目录

我正在使用 Ubuntu 20.04。我用 WordPress 创建了一个新网站,但它无法正常工作。

<IfModule mod_ssl.c>
    <VirtualHost _default_:443>
        ServerAdmin webmaster@localhost
        ServerName workplace.internaldomain.de:443
        Redirect permanent workplace.internaldomain.de https://workplace.internaldomain.de
        DocumentRoot /var/www/html/workplace/index.php
        <IfModule mod_headers.c>
            Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
            </IfModule>
        Redirect permanent http://workplace.internaldomain.de https://workplace.internaldomain.de


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


        SSLEngine on

        SSLCertificateFile  /etc/apache2/ssl/STAR_internaldomain_tv.crt
        SSLCertificateKeyFile   /etc/apache2/ssl/star_internaldomain_2019.key
        SSLCertificateChainFile /etc/apache2/ssl/CA_ov.bundle

        SSLProtocol             all -SSLv2 -SSLv3

        SSLHonorCipherOrder     on

        SSLOpenSSLConfCmd DHParameters /etc/apache2/ssl/dhparams.pem
        
    


        #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
        <FilesMatch "\.(cgi|shtml|phtml|php)$">
                SSLOptions +StdEnvVars
        </FilesMatch>
        <Directory /usr/lib/cgi-bin>
                SSLOptions +StdEnvVars
        </Directory>


    </VirtualHost>
</IfModule>

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

我收到以下错误:

[Fri Feb 05 00:06:42.876912 2021] [ssl:warn] [pid 68765] AH01909: workplace.internaldomain.de:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 05 00:06:42.877055 2021] [mpm_prefork:notice] [pid 68765] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Fri Feb 05 00:06:42.877060 2021] [core:notice] [pid 68765] AH00094: Command line: '/usr/sbin/apache2'

[Fri Feb 05 00:08:14.103266 2021] [php7:warn] [pid 70293] [client 10.30.251.10:62272] PHP Warning:  require(/var/www/html/workplace/wp-includes/version.php): failed to open stream: No such file or directory in /var/www/html/workplace/wp-settings.php on line 33
[Fri Feb 05 00:08:14.103340 2021] [php7:error] [pid 70293] [client 10.30.251.10:62272] PHP Fatal error:  require(): Failed opening required '/var/www/html/workplace/wp-includes/version.php' (include_path='.:/usr/share/php') in /var/www/html/workplace/wp-settings.php on line 33

有人可以帮帮我吗?

答案1

:443您的服务器名称末尾有一个额外的字符串,这被视为错误的服务器名称。按以下方式更改相关行:

ServerName workplace.internaldomain.de

并且做sudo systemctl restart apache2

相关内容