Apache httpd: Alias is inherited by virtual host?
Solution 1:
Settings not limited to a specific VirtualHost but placed in the main server configuration files (i.e. the httpd.conf
or in configuration snippets loaded with Include
and/or IncludeOptional
directives) are valid for the whole server and that includes any and all VirtualHosts.
That is by design:
Scope: Directives placed in the main configuration files apply to the entire server. If you wish to change the configuration for only a part of the server, you can scope your directives by placing them in
<Directory>
,<DirectoryMatch>, <Files>, <FilesMatch>, <Location>
, and<LocationMatch>
sections. These sections limit the application of the directives which they enclose to particular filesystem locations or URLs. They can also be nested, allowing for very fine grained configuration.
httpd has the capability to serve many different websites simultaneously. This is called Virtual Hosting. Directives can also be scoped by placing them inside
<VirtualHost>
sections, so that they will only apply to requests for a particular website.
Do not place directives in the main httpd.conf that you do not want to apply to all VirtualHosts.