303-300 · Question #108
In apache configuration which directives are used to restrict access based on host/domain name and IP address?
The correct answer is B. order, allow from and deny from. Option B is correct because Apache's classic access control system uses three directives together: Order (which sets evaluation precedence, e.g., Order deny,allow), Allow from (to permit specific hosts/IPs/domains), and Deny from (to block them) - all within <Directory>…
Question
In apache configuration which directives are used to restrict access based on host/domain name and IP address?
Options
- Arestrict and allow
- Border, allow from and deny from
- Cdeny and accept
- Dallow IP, deny IP, allow DOMAIN and deny DOMAIN
- Eorder, deny and accept
How the community answered
(30 responses)- B90% (27)
- C7% (2)
- E3% (1)
Explanation
Option B is correct because Apache's classic access control system uses three directives together: Order (which sets evaluation precedence, e.g., Order deny,allow), Allow from (to permit specific hosts/IPs/domains), and Deny from (to block them) - all within <Directory>, <Location>, or .htaccess blocks.
Why the distractors are wrong:
- A -
restrictis not a valid Apache directive;allowalone is incomplete withoutOrderandDeny. - C -
acceptdoes not exist in Apache; this mixes up Apache syntax with firewall/iptables terminology. - D -
allow IPanddeny DOMAINare not real Apache directives; the actual syntax isAllow from <host>andDeny from <host>, not separate IP/domain variants. - E -
acceptis again invalid; the correct pairing withOrderanddenyrequiresallow, notaccept.
Memory tip: Think "OAD" - Order, Allow, Deny - like a bouncer who first decides which rule wins (Order), then checks the guest list (Allow from) and the banned list (Deny from). If you remember the bouncer analogy, you'll never confuse it with firewall syntax like accept or made-up directives like restrict.
Topics
Community Discussion
No community discussion yet for this question.