- Home
- Server Administration
- LPIC-2 Linux Engineer 202
26.
An Apache server includes the following configuration line. Assuming the rest of the
configuration is in order, what file will the server deliver if a user type http://www.luna
.edu/index.htm in a Web browser and the server receives this request?
VirtualDocumentRoot /var/httpd/%-2/%-1
VirtualDocumentRoot /var/httpd/%-2/%-1
- A./var/httpd/www/luna/index.htm
- B./var/httpd/www/luna/edu/index.htm
- C./var/httpd/luna/www/index.htm
- D./var/httpd/luna/edu/index.htm
- Answer & Explanation
- Report
Answer : [D]
Explanation :
Explanation :
The numbers preceded by percent signs ( % ) in VirtualDocumentRoot are variables that refer to the dot - separated hostname components. Positive numbers count components from the start, and negative numbers count components from the end. Thus, given a hostname of www.luna.edu , % - 2 refers to luna and % - 1 refers to edu , making option D correct. The remaining options are all distortions of this correct answer. |
27.
You want to use the VirtualHost directive to define a limited number of virtual hosts on
an Apache server. Furthermore, this server has two network interfaces, one for your local
network ( eth0 , 172.24.21.78) and one for the Internet ( eth1 , 10.203.17.26). What directive
can you include to ensure that your virtual hosts are defined only on your local network?
- A.VirtualHostOnly eth0
- B.Bind eth0
- C.NameVirtualHost 172.24.21.78
- D.ExcludeVirtualHosts 10.203.17.26
- Answer & Explanation
- Report
Answer : [C]
Explanation :
Explanation :
The NameVirtualHost directive is required when using VirtualHost . It often takes an asterisk ( * ) as an option, but passing it an IP address instead causes virtual hosting to apply only to requests directed to the network interface associated with that IP address. Thus, option C is correct. The remaining options are all fictitious. |
28.
Which of the following is the best mode for a secure Apache server's private key files?
- A.0600
- B.0640
- C.0644
- D.0660
- Answer & Explanation
- Report
Answer : [A]
Explanation :
Explanation :
Permissions on the Apache private key file should be as restrictive as possible, which normally means 0600 (read and write for the owner, no access to anybody else) or even 0400 (read - only for the owner, no access to anybody else). Thus, option A is correct. In addition to this access, options B, C, and D all provide read access to members of the file's group; option C provides read access to all users; and option D provides write access to the file's group. These additions all constitute unnecessary security risks, making these options incorrect. |
29.
Which of the following tools caches Web (HTTP) accesses by clients, thus improving
performance on subsequent accesses to the same popular sites?
- A.Squid
- B.PHP
- C.lynx
- D.CGI
- Answer & Explanation
- Report
Answer : [A]
Explanation :
Explanation :
The Squid program is a caching proxy server, meaning that it provides the features described in the question, so option A is correct. PHP is a tool for running Web - centric scripts, so option B is incorrect. lynx is a text - based Web browser, so option C is incorrect. CGI is the Common Gateway Interface, a tool for running scripts from a Web server, so option D is incorrect. |
30.
How can you ensure that all access to normal Web sites (on port 80) from your local
network passes through a proxy server? (Select all that apply.)
- A.Use iptables on your router to redirect all traffic to the proxy server to go to the Internet directly.
- B.Use iptables on your proxy server to redirect all incoming port - 80 traffic to the proxy server's default port.
- C.Use iptables on your router to block all outgoing port - 80 traffic except from the proxy server.
- D.Use iptables on your router to redirect all outgoing port - 80 traffic to the proxy server, except from the proxy server itself.
- Answer & Explanation
- Report
Answer : [C, D]
Explanation :
Explanation :
Doing as option C suggests will block normal clients from accessing the Internet, forcing them to use their Web browsers'proxy settings to use your network's proxy server computer. Option D will use the proxy server more seamlessly, which requires less configuring but may not work well with some proxy configurations. Either option will do as the question asks. Option A makes little sense, because you can't redirect traffic aimed at a specific machine to go to the Internet at large; and if you could, this would do the opposite of what's requested. Option B would effectively make the proxy server run on two ports, port 80 and its native port, but this isn't what's specified by the question. |