[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#231452: Suggestion: Relative Includes in apache2.conf, and notes on Including linked-to directories



Package: apache2-common
Version: 2.0.48-7
Severity: wishlist

Just something that I thought about when reviewing the apache2.conf file:

Why not use relative paths for the Include directives, as they are
relative to the server root?


# Include module configuration:
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf

...could be written:

# Include module configuration:
Include mods-enabled/*.load
Include mods-enabled/*.conf


And:

# Include ports listing
Include /etc/apache2/ports.conf

# Include generic snippets of statements
Include /etc/apache2/conf.d

...could be written:

# Include ports listing
Include ports.conf

# Include generic snippets of statements
Include conf.d


Finally:

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled

...could be written:

# Include the virtual host configurations:
Include sites-enabled


My experience is that it is good to use relative paths where possible.

Although for clarity, absolute paths may be better. Furthermore, there's
always the danger of the allowance of relative paths disappearing in some
future version. This for instance happened to the AuthDigestFile and
AuthDigestGroupFile directives for mod_digest when I switched from Apache
2.0.48/Win32 to 2.0.48-5 (and up) on Debian, forcing me to use absolute
paths for digest authentication files.

Anyway, I thought it would be worth a thought.


Another interesting thing about Includes that could be worth noticing is
that if you try to include a directory, which actually is a symlink to a
directory, Apache will complain instead of including all files in the
(linked-to) directory. Adding a slash after the directory (link) name
takes care of it, and includes all files in the (linked-to) directory.

Best regards,
Björn

--
Björn Wiberg (bjorn.wiberg@home.se)
Homepage: http://bwiberg.dyndns.org/



Reply to: