Score:0

What difference does slash make in apache2.conf?

pk flag

The default apache2.conf contains this:

<Directory /usr/share>
...
<Directory /var/www/>

Why is there a trailing slash in one but not in the other directive? What difference does it make?

Side question: If I do not want to share anything from /usr/share, can I simply delete this part or set it to Require all denied?

Score:1
ar flag
bob

With regards to the trailing slash, as: https://serverfault.com/a/263219 states, the argument to a Directory directive must be directory path. Without a slash is the convention but either syntax is valid and has the same result.

Note that in other scenario's and in combination with other directives there may be differences, for example disabling the DirectorySlash directive may result in requests for http://www.example.com/directory-path getting different results displayed compared to the request for http://www.example.com/directory-path/

If I do not want to share anything from /usr/share, can I simply delete this part or set it to Require all denied?

Directory statements themselves do not make any content public.
(AFAIK Only the [Script]Alias and DocumentRoot directives and similar map URI paths to the file system.)
Directory blocks only apply specific settings to locations on a file system. That means that you can leave directory blocks like the one for for /usr/share even when you don't share content from there (yet). That does not have any security or performance impact.

lampstackxyz avatar
pk flag
Got it, thank you!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.