1

在不使用 ssl 的情况下,我的 apache conf 有一个如下所示的虚拟主机:

<VirtualHost 192.175.55.83:80>
ServerName nutra4you.com
ServerAlias www.nutra4you.com
DocumentRoot /home/media183/public_html
ServerAdmin webmaster@nutra4you.com
UseCanonicalName Off
CustomLog /usr/local/apache/domlogs/nutra4you.com combined
CustomLog /usr/local/apache/domlogs/nutra4you.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
## User nutra4yo # Needed for Cpanel::ApacheConf
UserDir enabled media183
<IfModule mod_suphp.c>
    suPHP_UserGroup media183 media183
</IfModule>
<IfModule !mod_disable_suexec.c>
    <IfModule !mod_ruid2.c>
        SuexecUserGroup media183 media183
    </IfModule>
</IfModule>
<IfModule mod_ruid2.c>
    RMode config
    RUidGid media183 media183
</IfModule>
ScriptAlias /cgi-bin/ /home/media183/public_html/cgi-bin/


# To customize this VirtualHost use an include file at the following location
# Include "/usr/local/apache/conf/userdata/std/2/nutra4yo/nutra4you.com/*.conf"

我基本上希望一切都www.nutra4you.com从 media183 用户运行。如果没有 ssl,它可以完美运行!

但是,一旦 SSL 开启,例如: https://www.nutra4you.com/checkout.php?b=12

我得到内部服务器错误,并抛出:

 [Wed Jun 26 16:49:05 2013] [error] [client 98.175.107.93] File does not exist: /home/media183/public_html/500.shtml, referer: http://www.nutra4you.com/product.php?b=12
[Wed Jun 26 16:49:05 2013] [error] [client 98.175.107.93] SoftException in Application.cpp:422: Mismatch between target UID (685) and UID (672) of file "/home/media183/public_html/checkout.php", referer: http://www.nutra4you.com/product.php?b=12

这只是不允许的事情吗?

SSL 虚拟主机:

<IfModule mod_ssl.c>
<VirtualHost 192.175.55.83:80>
    ServerName nutra4you.com
    ServerAlias www.nutra4you.com
    DocumentRoot /home/media183/public_html
    ServerAdmin webmaster@nutra4you.com
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/nutra4you.com combined
    CustomLog /usr/local/apache/domlogs/nutra4you.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User nutra4yo # Needed for Cpanel::ApacheConf
    UserDir enabled media183
    <IfModule mod_suphp.c>
        suPHP_UserGroup media183 media183
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        <IfModule !mod_ruid2.c>
            SuexecUserGroup media183 media183
        </IfModule>
    </IfModule>
    <IfModule mod_ruid2.c>
        RMode config
        RUidGid media183 media183
    </IfModule>
    ScriptAlias /cgi-bin/ /home/media183/public_html/cgi-bin/


    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/nutra4yo/nutra4you.com/*.conf"

</VirtualHost>
</IfModule>
4

1 回答 1

2

您的 ssl 虚拟主机不正确。SSL 必须在与 HTTP 不同的端口上运行......通常是 443。所以在这种情况下,因为你在 80 上拥有它,它与你的初始非 ssl vhost 冲突,并且无论如何都没有为 ssl 配置。因此,当您通过 HTTPS 访问该站点时,您仍然会获得default-ssl虚拟主机。

<IfModule mod_ssl.c>
# Needed to change the port below from 80 to 443
<VirtualHost 192.175.55.83:443>
    # the rest of your configuration
</VirtualHost>
</IfModule>

此外,您还缺少一些 SSL 特定指令。我认为,如果它们没有在虚拟主机中单独定义,则在所有配置中定义的服务器范围的会启动,但您需要仔细检查:http ://httpd.apache.org/docs/2.2/mod/mod_ssl.html

于 2013-06-27T16:28:49.590 回答