我刚刚从 cPanel 创建了一个名为 virtual 的子域名,它返回了 500 错误。当我检查 error_log 时,我看到以下错误:
AH00124:由于可能的配置错误,请求超出了 10 次内部重定向的限制。如有必要,请使用“LimitInternalRecursion”增加限制。使用“LogLevel debug”获取回溯。,引用者:http://myhostname.com/index.html
这是完整日志:
[Mon May 09 06:21:16.819771 2022] [core:error] [pid 16737:tid 47256050861824] [client 182.2.38.229:64126] AH00124: Request exceeded the limit of 10internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://virtual.myhostname.com/index.html
[Mon May 09 06:21:16.819775 2022] [core:debug] [pid 16737:tid 47256050861824] core.c(3931): [client 182.2.38.229:64126] AH00121: r->uri = /public/path/public/path/public/path/public/path/public/path/public/path/public/path/public/path/public/path/public/path/favicon.ico, referer: http://virtual.myhostname.com/index.html
[Mon May 09 06:21:16.819778 2022] [core:debug] [pid 16737:tid 47256050861824] core.c(3938): [client 182.2.38.229:64126] AH00122: redirected from r->uri = /public/path/public/path/public/path/public/path/public/path/public/path/public/path/public/path/public/path/favicon.ico, referer: http://virtual.myhostname.com/index.html
[Mon May 09 06:21:16.819781 2022] [core:debug] [pid 16737:tid 47256050861824] core.c(3938): [client 182.2.38.229:64126] AH00122: redirected from r->uri = /public/path/public/path/public/path/public/path/public/path/public/path/public/path/public/path/favicon.ico, referer: http://virtual.myhostname.com/index.html
[Mon May 09 06:21:16.819784 2022] [core:debug] [pid 16737:tid 47256050861824] core.c(3938): [client 182.2.38.229:64126] AH00122: redirected from r->uri = /public/path/public/path/public/path/public/path/public/path/public/path/public/path/favicon.ico, referer: http://virtual.myhostname.com/index.html
[Mon May 09 06:21:16.819787 2022] [core:debug] [pid 16737:tid 47256050861824] core.c(3938): [client 182.2.38.229:64126] AH00122: redirected from r->uri = /public/path/public/path/public/path/public/path/public/path/public/path/favicon.ico, referer: http://virtual.myhostname.com/index.html
[Mon May 09 06:21:16.819790 2022] [core:debug] [pid 16737:tid 47256050861824] core.c(3938): [client 182.2.38.229:64126] AH00122: redirected from r->uri = /public/path/public/path/public/path/public/path/public/path/favicon.ico, referer: http://virtual.myhostname.com/index.html
[Mon May 09 06:21:16.819793 2022] [core:debug] [pid 16737:tid 47256050861824] core.c(3938): [client 182.2.38.229:64126] AH00122: redirected from r->uri = /public/path/public/path/public/path/public/path/favicon.ico, referer: http://virtual.myhostname.com/index.html
[Mon May 09 06:21:16.819796 2022] [core:debug] [pid 16737:tid 47256050861824] core.c(3938): [client 182.2.38.229:64126] AH00122: redirected from r->uri = /public/path/public/path/public/path/favicon.ico, referer: http://virtual.myhostname.com/index.html
[Mon May 09 06:21:16.819799 2022] [core:debug] [pid 16737:tid 47256050861824] core.c(3938): [client 182.2.38.229:64126] AH00122: redirected from r->uri = /public/path/public/path/favicon.ico, referer: http://virtual.myhostname.com/index.html
[Mon May 09 06:21:16.819802 2022] [core:debug] [pid 16737:tid 47256050861824] core.c(3938): [client 182.2.38.229:64126] AH00122: redirected from r->uri = /public/path/favicon.ico, referer: http://virtual.myhostname.com/index.html
[Mon May 09 06:21:16.819811 2022] [core:debug] [pid 16737:tid 47256050861824] core.c(3938): [client 182.2.38.229:64126] AH00122: redirected from r->uri = /favicon.ico, referer: http://virtual.myhostname.com/index.html
虚拟主机路径应该在/home/user/public_html/path
,但为什么从日志来看它被重定向到/public/path
?我没有该路径上的 .htaccess ,即使我添加了 .htaccess 也没有效果。
这是由 WHM/cPanel 生成的虚拟主机:
<VirtualHost myip:80>
ServerName virtual.myhostname.com
ServerAlias www.virtual.myhostname.com
DocumentRoot /home/user/public_html/path
UseCanonicalName Off
## User user # Needed for Cpanel::ApacheConf
<IfModule userdir_module>
<IfModule !mpm_itk.c>
<IfModule !ruid2_module>
<IfModule !mod_passenger.c>
UserDir disabled
UserDir enabled user
</IfModule>
</IfModule>
</IfModule>
</IfModule>
<IfModule mod_include.c>
<Directory "/home/user/public_html/path">
SSILegacyExprParser On
</Directory>
</IfModule>
<Proxymatch ^https?://127\.0\.0\.1:(2082|2083|2077|2078|2079|2080|2086|2087|2095|2096)/>
<IfModule security2_module>
SecRuleEngine Off
</IfModule>
<IfModule security3_module>
modsecurity_rules 'SecRuleEngine Off'
</IfModule>
</Proxymatch>
<IfModule mod_suphp.c>
suPHP_UserGroup user user
</IfModule>
<IfModule suexec_module>
<IfModule !mod_ruid2.c>
SuexecUserGroup user user
</IfModule>
</IfModule>
<IfModule ruid2_module>
RMode config
RUidGid user user
</IfModule>
<IfModule mpm_itk.c>
AssignUserID user user
</IfModule>
<IfModule mod_passenger.c>
PassengerUser user
PassengerGroup user
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ /home/user/public_html/path/cgi-bin/
</IfModule>
</IfModule>
</VirtualHost>
另一个子域名使用与上面相同的虚拟主机配置,但运行正常。该问题的原因是什么?
答案1
public_html
在我从 WHM 调整设置中禁用“将文档根目录限制为 public_html”并从子域目录中删除后,它运行正常。所以我的当前路径/home/user/path
。
在某些情况下,我的服务器似乎具有自动重定向路径。