nerdexam
LPI

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>…

Access Control

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)
  • B
    90% (27)
  • C
    7% (2)
  • E
    3% (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 - restrict is not a valid Apache directive; allow alone is incomplete without Order and Deny.
  • C - accept does not exist in Apache; this mixes up Apache syntax with firewall/iptables terminology.
  • D - allow IP and deny DOMAIN are not real Apache directives; the actual syntax is Allow from <host> and Deny from <host>, not separate IP/domain variants.
  • E - accept is again invalid; the correct pairing with Order and deny requires allow, not accept.

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

#Apache directives#Access control lists#IP filtering#Host-based restrictions

Community Discussion

No community discussion yet for this question.

Full 303-300 Practice