WHM – 仅通过https提供的内容,http引发404

我只是使用WHMbuild立一个VPS。 我设置了帐户,并安装了一个SSL证书。 一切正常使用HTTPS连接,但任何时候我尝试通过香草HTTP加载任何东西,我只是得到一个404错误。

我查看了生成的VirtualHost设置,并且端口80和443共享相同的文档根目录。 这只发生在SSL证书configuration的子域(secure.example.com)上。 通过常规域(example.com)服务HTTP可以正常工作。

我错过了什么? 谢谢。

更新:

这是我的虚拟主机configuration。

example.com

<VirtualHost server.ip.address:80> ServerName example.com ServerAlias www.example.com DocumentRoot /home/username/public_html ServerAdmin [email protected] UseCanonicalName Off CustomLog /usr/local/apache/domlogs/example.com combined CustomLog /usr/local/apache/domlogs/example.com-bytes_log "%{%s}t %I .\n%{%s}t %O ." ## User username # Needed for Cpanel::ApacheConf UserDir disabled UserDir enabled username <IfModule mod_suphp.c> suPHP_UserGroup username username </IfModule> <IfModule !mod_disable_suexec.c> SuexecUserGroup username username </IfModule> ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/ # To customize this VirtualHost use an include file at the following location # Include "/usr/local/apache/conf/userdata/std/2/username/example.com/*.conf" </VirtualHost> 

secure.example.com

 <VirtualHost server.ip.address:80> ServerName secure.example.com ServerAlias www.secure.example.com DocumentRoot /home/username/public_html/secure ServerAdmin [email protected] UseCanonicalName Off CustomLog /usr/local/apache/domlogs/secure.example.com combined CustomLog /usr/local/apache/domlogs/secure.example.com-bytes_log "%{%s}t %I .\n%{%s}t %O ." ## User username # Needed for Cpanel::ApacheConf UserDir disabled UserDir enabled username <IfModule mod_suphp.c> suPHP_UserGroup username username </IfModule> <IfModule !mod_disable_suexec.c> SuexecUserGroup username username </IfModule> ScriptAlias /cgi-bin/ /home/username/public_html/secure/cgi-bin/ # To customize this VirtualHost use an include file at the following location # Include "/usr/local/apache/conf/userdata/std/2/username/secure.example.com/*.conf" </VirtualHost> 

secure.example.com:443

 <VirtualHost server.ip.address:443> ServerName secure.example.com ServerAlias www.secure.example.com DocumentRoot /home/username/public_html/secure ServerAdmin [email protected] UseCanonicalName Off CustomLog /usr/local/apache/domlogs/secure.example.com combined CustomLog /usr/local/apache/domlogs/secure.example.com-bytes_log "%{%s}t %I .\n%{%s}t %O ." ## User username # Needed for Cpanel::ApacheConf UserDir disabled UserDir enabled username <IfModule mod_suphp.c> suPHP_UserGroup username username </IfModule> <IfModule !mod_disable_suexec.c> SuexecUserGroup username username </IfModule> ScriptAlias /cgi-bin/ /home/username/public_html/secure/cgi-bin/ SSLEngine on SSLCertificateFile /etc/ssl/certs/secure.example.com.crt SSLCertificateKeyFile /etc/ssl/private/secure.example.com.key CustomLog /usr/local/apache/domlogs/secure.example.com-ssl_log combined SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown <Directory "/home/username/public_html/secure/cgi-bin"> SSLOptions +StdEnvVars </Directory> # To customize this VirtualHost use an include file at the following location # Include "/usr/local/apache/conf/userdata/ssl/2/username/secure.example.com/*.conf" </VirtualHost> 

你确定这些虚拟主机configuration正在被加载? (也就是说,他们被包含在apache2.conf中)? 如果secure.example.comconfiguration未被加载,secure.example.com的端口80上的请求可能由example.com提供服务,因此得到404s,因为文件URI将是错误的。 (要检查这个概念,请尝试添加secure/请求URL,看看它们是否工作。)