doudanglang5826 2019-05-07 20:26
浏览 244

SSLEngine打开时,DocumentRoot不存在

I have a Virtual Host Setup on an Apache2 Server on a Debian VM, I've created an SSL certificate from GoDaddy and downloaded the crt files (certificate and chain)

Before adding SSL, The DocumentRoot was pointing to :

  • /var/www/html/websitename/public_html/loader.php

and it was working just fine.

But, as I added SSLEngineOn, SSLCertificationFile, and SSLCertificationChainFile in the Virtual Host, the Apache2 Server refuses to start, here's the server log:

May 07 20:05:05 ns507219 systemd[1]: Starting The Apache HTTP Server...
May 07 20:05:05 ns507219 apachectl[2228]: AH00112: Warning: DocumentRoot [/var/www/html/websitename/public_html/loader.php] does not exist
May 07 20:05:05 ns507219 apachectl[2228]: AH00112: Warning: DocumentRoot [/var/www/html/websitename/public_html/loader.php] does not exist
May 07 20:05:05 ns507219 apachectl[2228]: AH00112: Warning: DocumentRoot [/var/www/html/websitename/public_html/loader.php] does not exist
May 07 20:05:05 ns507219 apachectl[2228]: Action 'start' failed.

Here's my config :

<VirtualHost websitename.ca:80>
    ServerAdmin admin@websitename.ca
    #SSLEngine on
    #SSLCertificateFile /etc/ssl/certs/mycertificate.crt
    #SSLCertificateChainFile /etc/ssl/certs/mychain.crt
    DocumentRoot /var/www/html/websitename/public_html/loader.php
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

        <FilesMatch "\.php$">
            SetHandler "proxy:fcgi://127.0.0.1:9000/"
        </FilesMatch>
</VirtualHost>
<IfModule mod_ssl.c>
    <VirtualHost websitename.ca:443>
        ServerAdmin admin@websitename.ca

        DocumentRoot /var/www/html/websitename/public_html/loader.php
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        SSLEngine on

        SSLCertificateFile /etc/ssl/certs/mycertificate.crt
        SSLCertificateChainFile /etc/ssl/certs/mychain.crt


        <FilesMatch "\.(cgi|shtml|phtml|php)$">
                SSLOptions +StdEnvVars
        </FilesMatch>
        <Directory /usr/lib/cgi-bin>
                SSLOptions +StdEnvVars
        </Directory>
    </VirtualHost>
</IfModule>

If I remove the if condition, the settings work normally, but SSL doesn't.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 thinkphp6配合social login单点登录问题
    • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch