2

Ok, not sure why this is occuring.

So, I get the message

The Alias directive in /etc/httpd/conf.d/awstats.conf at line 3 will probably never match because it overlaps an earlier Alias.

and

The Alias directive in /etc/httpd/conf.d/welcome.conf at line 18 will probably never match because it overlaps an earlier Alias.

but here are the first 15 lines of my /httpd/httpd.conf file

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  <- THIS IS WHERE INCLUDES BEGIN
Include conf.modules.d/*.conf

There are absolutely no Alias or ScriptAlias entries before line 14, which is the Include conf.d/*.conf.

So, in reality, the first time an Alias entry is encountered, is in fact in the awstats.conf file under /conf.d/*.conf.

Why is it that I am getting this error then?

The server runs, it's just an annoyance.

EDIT: did grep Alias on /etc/httpd/conf.d/*.conf and here are the results ->

/etc/httpd/conf.d/awstats.conf:Alias /awstatsclasses "/usr/share/awstats/wwwroot/classes/"
/etc/httpd/conf.d/awstats.conf:Alias /awstatscss "/usr/share/awstats/wwwroot/css/"
/etc/httpd/conf.d/awstats.conf:Alias /awstatsicons "/usr/share/awstats/wwwroot/icon/"
/etc/httpd/conf.d/awstats.conf:ScriptAlias /awstats/ "/usr/share/awstats/wwwroot/cgi-bin/"
/etc/httpd/conf.d/welcome.conf:Alias /.noindex.html /usr/share/httpd/noindex/index.html
/etc/httpd/conf.d/welcome.conf:Alias /noindex/css/bootstrap.min.css /usr/share/httpd/noindex/css/bootstrap.min.css
/etc/httpd/conf.d/welcome.conf:Alias /noindex/css/open-sans.css /usr/share/httpd/noindex/css/open-sans.css
/etc/httpd/conf.d/welcome.conf:Alias /images/apache_pb.gif /usr/share/httpd/noindex/images/apache_pb.gif
/etc/httpd/conf.d/welcome.conf:Alias /images/poweredby.png /usr/share/httpd/noindex/images/poweredby.png
1
  • Thanks but I just updated the debug command: grep -E "Alias|Redirect" conf.d/*.conf
    – HBruijn
    Feb 5, 2015 at 12:34

2 Answers 2

4

The easiest to understand is that Apache generates a single configuration file internally, by parsing the main httpd.conf line by line and includes the external sections at the locations where the Include or the IncludeOptional directive is used, before continuing with the next line.

When wildcards are used in Include file-system paths the includes are parsed in lexicographical (dictionary) order, conf.d/alice.conf will come before conf.d/bob.conf.

With many directives order matters, with some the last occurrence is used, with others a greater scope before a smaller scope will win etc.

The rules for the Alias directive are:

Aliases and Redirects occurring in different contexts are processed like other directives according to standard merging rules. But when multiple Aliases or Redirects occur in the same context (for example, in the same section) they are processed in a particular order.

First, all Redirects are processed before Aliases are processed, and therefore a request that matches a Redirect or RedirectMatch will never have Aliases applied. Second, the Aliases and Redirects are processed in the order they appear in the configuration files, with the first match taking precedence.

For this reason, when two or more of these directives apply to the same sub-path, you must list the most specific path first in order for all the directives to have an effect. For example, the following configuration will work as expected:

Alias /foo/bar /baz 
Alias /foo /gaq 

But if the above two directives were reversed in order, the /foo Alias would always match before the /foo/bar Alias, so the latter directive would be ignored.

For troubleshooting a good first start in your case is a simple grep -E "Alias|Redirect" conf.d/*.conf

4
  • Added the output of grep Alias to my Post. Feb 5, 2015 at 12:31
  • same output. not sure what that means Feb 5, 2015 at 13:36
  • Then I'm a bit lost too!
    – HBruijn
    Feb 5, 2015 at 13:41
  • OK, so I'm not the only one :) Feb 5, 2015 at 14:00
0

I had a similar error resulting from incorrect Host Configuration. To resolv it simply add:

<VirtualHost *:80>
Here Host Configuration
</VirtualHost>

Check configure vhost. In my case the error caused the wrong configuration of the virtual host. It looked like this: /etc/apache2/sites-available/hitman.conf

ServerAdmin marek@localhost
ServerName hitman
DocumentRoot /home/marek/public_html/hitman

correct configuration:

<VirtualHost *:80>
ServerAdmin marek@localhost
ServerName hitman
DocumentRoot /home/marek/public_html/hitman
</VirtualHost>
2
  • I find it very unclear what your proposed solution is.
    – kasperd
    Mar 10, 2016 at 13:55
  • 1
    A more detailed description of the problem solution. I hope that helps. Mar 11, 2016 at 15:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .