Apache Web Server Final Quiz
Test your Apache HTTP Server knowledge with 10 self-paced multiple-choice questions covering configuration, virtual hosts, modules, access control, logging, service administration, and HTTPS.
Quiz Instructions
This final assessment contains 10 multiple-choice questions about Apache HTTP Server administration and configuration. It is self-paced, so there is no time limit.
Choose the best answer for each question. You may leave the assessment and resume it later. After submitting your answers, use the answer-review stage to compare your choices with the correct answers and explanations.
Quiz Coverage Map
| Question number | Topic | Skill assessed | Question format |
|---|---|---|---|
| 1 | Apache fundamentals | Identify the web server's role | Definition |
| 2 | Configuration structure | Recognize directives, includes, and syntax testing | Scenario |
| 3 | Document roots | Map a URL path to a filesystem path | Practical diagnosis |
| 4 | Virtual hosting | Use hostnames to select a site | Configuration interpretation |
| 5 | Modules | Distinguish module enablement from feature configuration | Concept |
| 6 | Access control | Separate authentication from authorization | Security scenario |
| 7 | Logging and status codes | Choose appropriate diagnostic sources | Troubleshooting |
| 8 | Service administration | Validate and apply changes safely | Command selection |
| 9 | HTTPS | Recognize TLS virtual-host requirements | Configuration interpretation |
| 10 | Integrated troubleshooting | Diagnose a failed or misdirected request | Scenario |
Questions
Question 1: Apache fundamentals
What is the primary role of Apache HTTP Server?
- It is a web browser that requests pages from other servers.
- It is web server software that receives HTTP requests and returns web content or responses.
- It is an operating system used to host websites.
- It is a database server that stores all website data.
Question 2: Configuration structure
An administrator edits an included Apache configuration fragment. Which action should normally occur before applying the change?
- Delete the main configuration file.
- Run a configuration syntax test such as
apachectl configtestorhttpd -t. - Clear every access log.
- Change the server's DNS records.
Question 3: Document roots
A virtual host has DocumentRoot /var/www/example. A client requests https://example.test/images/logo.png. Which filesystem path does Apache generally try first for the requested resource?
/images/logo.png/var/www/example/images/logo.png/var/www/example/https/example.test/logo.png/etc/apache2/images/logo.png
Question 4: Virtual hosting
Which statement best describes name-based virtual hosting?
- It requires one physical server for every hostname.
- It uses the requested hostname, commonly from the HTTP
Hostheader, to select among sites configured inVirtualHostblocks. - It replaces DNS with filesystem permissions.
- It allows only HTTPS sites to share an Apache instance.
Question 5: Modules
Which statement correctly distinguishes enabling an Apache module from configuring its feature?
- Enabling a module automatically completes every feature configuration.
- A module supplies or extends functionality, but directives and related settings may still be required to use that functionality.
- Modules are only used for log rotation.
- Modules are separate operating systems loaded by Apache.
Question 6: Access control and authentication
A protected directory must require valid credentials and then allow only approved users. Which statement is correct?
- Authentication verifies identity; authorization determines whether access is permitted.
- Authentication and authorization both mean selecting a document root.
- Authorization verifies identity; authentication selects the virtual host.
- Neither process requires directory-level configuration.
Question 7: Logging and status codes
A user reports that a page returns 404 Not Found. Which investigation is most appropriate first?
- Inspect the access log and error log, then verify the selected virtual host, URL-to-filesystem mapping, and requested file.
- Replace the TLS certificate immediately.
- Stop the database server.
- Assume that the client browser is the Apache configuration file.
Question 8: Service administration
You have edited a valid Apache configuration and want to apply it while minimizing disruption to active connections. Which sequence is best?
- Run a syntax test, then perform a graceful reload such as
systemctl reload apache2orsystemctl reload httpd. - Skip validation and stop Apache permanently.
- Delete the error log, then start a second Apache instance on the same port.
- Restart the operating system before checking the configuration.
Question 9: HTTPS and secure delivery
Which set of configuration elements is most relevant to serving example.test over HTTPS?
<VirtualHost *:443>,ServerName, TLS support, and valid certificate and private-key paths.- Only a
DocumentRootdirective on port 80. - Only an access log and a database password.
- A browser plugin with no Apache configuration.
Question 10: Integrated troubleshooting
Two domains share one Apache server, but one domain displays the other domain's website. Which cause is most likely?
- The server has no filesystem at all.
- The
ServerName,ServerAlias, orVirtualHostmatching is incorrect, so Apache selects a different or default virtual host. - The access log is automatically changing all HTML files.
- HTTPS always disables name-based virtual hosting.
Answer Review
Submit or record your answers before reading this section. Then compare each response with the answer and explanation.
1. Correct answer: B
Apache HTTP Server is web server software. It receives HTTP or HTTPS requests and returns content, redirects, errors, or other HTTP responses. A browser is the client, while an operating system, database server, and application code perform different roles.
2. Correct answer: B
A configuration file contains Apache directives, which are instructions and settings. The main configuration file can include additional fragments. A syntax test such as apachectl configtest or httpd -t helps catch errors before a reload or restart.
3. Correct answer: B
DocumentRoot identifies the filesystem directory used for a site's default content. Apache combines that directory with the URL path, so /images/logo.png maps to /var/www/example/images/logo.png in this example.
4. Correct answer: B
A VirtualHost block defines settings for a site or endpoint. ServerName identifies the primary hostname, and ServerAlias adds other hostnames. Apache uses the request's host information to select the matching site, with default virtual-host behavior applying when no suitable match exists.
5. Correct answer: B
A module is a loadable or built-in Apache component that supplies a feature, such as rewriting, TLS, authentication, proxying, or directory indexing. Enabling the module makes its directives available; it does not necessarily configure the feature for a particular site.
6. Correct answer: A
Authentication verifies a user's identity. Authorization decides whether that user, or an unauthenticated client when permitted, may access a resource. Directory-level rules commonly use directives such as AuthType, AuthName, AuthUserFile, and Require.
7. Correct answer: A
An access log records client requests and response details. An error log records warnings, errors, and diagnostic information. A 404 is a client-error status indicating that the requested resource was not found; check the selected virtual host, document root, URL path, file placement, and relevant logs.
8. Correct answer: A
Validate syntax before activating a change. A reload applies configuration without fully stopping the service, and a graceful reload is preferred for many updates because it minimizes disruption to active connections. A restart stops and starts the service and may interrupt connections. Starting launches a stopped service; stopping terminates it.
9. Correct answer: A
HTTPS is HTTP protected by TLS encryption. Apache needs TLS-capable module support, a virtual host listening on port 443, a matching ServerName, and valid certificate and private-key settings such as SSLCertificateFile and SSLCertificateKeyFile.
10. Correct answer: B
The symptom commonly indicates incorrect host-header matching or virtual-host configuration. Check each site's ServerName, ServerAlias, DocumentRoot, enabled configuration, and the default virtual host. Also confirm that DNS sends each hostname to the intended Apache server.
Reference Configurations
Name-based virtual host
<VirtualHost *:80>
ServerName example.test
ServerAlias www.example.test
DocumentRoot /var/www/example
ErrorLog /var/log/apache2/example-error.log
CustomLog /var/log/apache2/example-access.log combined
</VirtualHost>Protected directory
<Directory /var/www/example/private>
AuthType Basic
AuthName "Restricted area"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</Directory>HTTPS virtual host
<VirtualHost *:443>
ServerName example.test
DocumentRoot /var/www/example
SSLEngine on
SSLCertificateFile /path/to/certificate.pem
SSLCertificateKeyFile /path/to/private-key.pem
</VirtualHost>Common Apache Administration Actions
| Action | Typical purpose | Expected effect | When to use it |
|---|---|---|---|
| Configuration test | Check syntax | Reports errors without applying a service change | Before reloads, restarts, or troubleshooting startup failures |
| Start | Launch a stopped service | Apache begins listening on configured ports | When the service is not running |
| Graceful reload | Apply configuration changes | Workers finish current work while new configuration is loaded | For many routine configuration updates |
| Restart | Stop and start Apache | Reinitializes the service and may interrupt connections | When a full restart is required or reload is insufficient |
| Stop | Terminate the service | Apache stops serving requests | For maintenance or controlled shutdown |
Useful HTTP Status Codes for Apache Diagnosis
| Status code | Category | Typical meaning | Likely investigation area |
|---|---|---|---|
| 200 | Success | Request completed successfully | Confirm content and application behavior |
| 301 or 302 | Redirection | Client should request another location | Redirect directives, HTTPS redirects, and application routing |
| 403 | Client error | Access is forbidden | Directory authorization, filesystem permissions, and access rules |
| 404 | Client error | Requested resource was not found | Document root, URL path, file placement, and virtual-host selection |
| 500 | Server error | Unexpected server-side failure | Error log, application code, modules, and runtime configuration |
| 503 | Server error | Service temporarily unavailable | Backend availability, proxy configuration, and server capacity |
Score Interpretation
- 9–10 correct: You are ready for practical introductory Apache administration tasks.
- 7–8 correct: Review the missed topics, especially configuration context, virtual hosts, and service operations.
- 5–6 correct: Revisit document roots, modules, access control, logs, and HTTPS before attempting the quiz again.
- 0–4 correct: Review the course fundamentals and prerequisites, then retake this self-paced assessment.
For additional practice, see Linux Quiz 1 for related command-line and administration concepts.