LCA Web Server & Database Administration 5 — Questions and Answers
Question 1: Which Apache configuration file format is used in Debian-based systems to enable or disable sites?
- Symlinks in /etc/apache2/sites-enabled/ managed by a2ensite/a2dissite (Correct answer)
- Direct edits to /etc/apache2/httpd.conf only
- XML files in /etc/apache2/vhosts.d/
- INI-style files in /etc/apache2/sites/
Correct answer: Symlinks in /etc/apache2/sites-enabled/ managed by a2ensite/a2dissite
Debian-based systems use a2ensite to create symlinks from sites-available to sites-enabled, which Apache reads at startup.
Question 2: What is the purpose of the PostgreSQL pg_hba.conf file?
- Defines memory and performance tuning parameters
- Controls client authentication methods and access rules (Correct answer)
- Lists scheduled maintenance tasks for autovacuum
- Configures replication slot settings
Correct answer: Controls client authentication methods and access rules
pg_hba.conf (host-based authentication) defines which hosts can connect to which databases as which users and by what authentication method.
Question 3: Which Nginx directive defines a named location block for internal redirects only?
- location @name {} (Correct answer)
- location internal /name {}
- location #name {}
- location ~name {}
Correct answer: location @name {}
A named location prefixed with @ (e.g., location @fallback) is only accessible via internal Nginx directives like try_files or error_page, not directly by clients.
Question 4: When configuring MariaDB binary logging for replication, which configuration file option enables it?
- binlog=ON
- log_bin=/var/log/mysql/mysql-bin (Correct answer)
- enable_binlog=1
- replication_log=ON
Correct answer: log_bin=/var/log/mysql/mysql-bin
Setting log_bin in my.cnf with a file path enables binary logging, which is required for MySQL/MariaDB replication.
Question 5: Which Apache module enables URL rewriting using regular expressions?
- mod_alias
- mod_redirect
- mod_rewrite (Correct answer)
- mod_map
Correct answer: mod_rewrite
mod_rewrite provides a powerful rule-based URL rewriting engine using Perl-compatible regular expressions via RewriteRule and RewriteCond directives.
Question 6: In MySQL, what does the binary log format 'ROW' record?
- The SQL statements executed
- The actual data changes for each affected row (Correct answer)
- Only DDL statements like CREATE and ALTER
- Compressed checksums of changed pages
Correct answer: The actual data changes for each affected row
ROW-based binary logging records the actual before and after values for each changed row, making replication more precise and safe than STATEMENT format.
Question 7: Which Nginx directive sets the number of worker processes, typically matched to CPU cores?
- worker_threads
- worker_processes (Correct answer)
- process_count
- cpu_workers
Correct answer: worker_processes
worker_processes defines how many Nginx worker processes run; setting it to auto detects and matches the number of available CPU cores.
Which Apache configuration file format is used in Debian-based systems to enable or disable sites?