这是原来的帖子服务器故障:
我的 httpd.conf 文件的前 15 行
ServerSignature Off
ServerTokens Prod
ServerRoot "/etc/httpd"
Listen *:80
Listen *:443
User apache
Group apache
ServerAdmin hostmaster@localhost
ServerName 192.168.1.200:80
Include conf.d/*.conf
Include conf.modules.d/*.conf
请注意,第一次插入外部文件是在 Include conf.d/*.conf 行。并且,包含的第一个文件是 awstats.conf,因为它是按字母顺序排列的。
awstats.conf 的第一行是:
Alias /awstatsclasses "/usr/share/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/share/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/share/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/share/awstats/wwwroot/cgi-bin/"
因此,自 apache 开始加载 conf 文件以来,遇到的第一个 Alias 和 ScriptAlias 基本上是在 16 行之后。然而,我仍然收到错误“别名指令可能永远不会匹配,因为它与早期的别名重叠”。
既然到目前为止还没有包含其他 ALIAS 指令,它怎么会重叠呢?我缺少什么?
编辑:
运行systemctl status httpd
结果出现上述错误:
The Alias directive in /etc/httpd/conf.d/awstats.conf at line 3 will probably never match because it overlaps an earlier Alias.
The Alias directive in /etc/httpd/conf.d/awstats.conf at line 4 will probably never match because it overlaps an earlier Alias.
The Alias directive in /etc/httpd/conf.d/awstats.conf at line 5 will probably never match because it overlaps an earlier Alias.
The ScriptAlias directive in /etc/httpd/conf.d/awstats.conf at line 6 will probably never match because it overlaps an earlier ScriptAlias.
答案1
从您的 grep 结果显示没有其他冲突的别名,最可能的解释是您以某种方式将该文件包含了两次。查找任何附加Include
或IncludeOptional
指令。 (特别是在 2.2→2.4 升级时可能会发生这种情况,就像IncludeOptional
新的一样。)
处理类似问题的另一个故障排除技巧是mod_info 可以在启动时转储配置这应该显示完整的配置。