LFCS · Question #381
The apache administrator has added the following lines to the configuration files: <Directory /> AllowOverride None </Directory> What is the purpose of this directive?
The correct answer is C. It stops users from setting up .htaccess files unless specifically allowed in additional configuration. The AllowOverride None directive within a <Directory /> block globally disables the processing of .htaccess files for directory-specific configuration overrides.
Question
Options
- AIt stops users from serving HTML files from their home directories.
- BIt prevents HTML files from being served out of the / directory.
- CIt stops users from setting up .htaccess files unless specifically allowed in additional configuration.
- DIt prevents CGI scripts from modifying apache features dynamically.
How the community answered
(33 responses)- A3% (1)
- C94% (31)
- D3% (1)
Why each option
The `AllowOverride None` directive within a `<Directory />` block globally disables the processing of `.htaccess` files for directory-specific configuration overrides.
`AllowOverride None` does not specifically prevent serving HTML files from home directories; rather, it prevents `.htaccess` files from being used to enable such serving (e.g., via `UserDir` directives).
This directive prevents `.htaccess` files from being used in the `/` directory and its subdirectories, not HTML files from being served directly from `/`. Serving files from `/` is controlled by other directives like `DocumentRoot`.
The `AllowOverride` directive explicitly controls which directives placed in `.htaccess` files are allowed to override server configuration for a given directory. Setting `AllowOverride None` for the root directory (`/`) means that no `.htaccess` files anywhere will be processed, effectively preventing users from setting up local configuration overrides unless specifically re-enabled in subdirectories.
While CGI scripts can be enabled or disabled via `.htaccess`, `AllowOverride None` itself prevents *any* `.htaccess` file from functioning, which indirectly affects CGI if they rely on `.htaccess` for configuration, but its primary purpose is not *only* about CGI scripts modifying Apache features dynamically.
Concept tested: Apache .htaccess file control
Source: https://httpd.apache.org/docs/2.4/mod/core.html#allowoverride
Topics
Community Discussion
No community discussion yet for this question.