LCA Web Server & Database Administration 2 — Questions and Answers
Question 1: Which Apache directive controls the maximum number of simultaneous client connections?
- MaxClients
- MaxRequestWorkers (Correct answer)
- ServerLimit
- ThreadLimit
Correct answer: MaxRequestWorkers
MaxRequestWorkers (formerly MaxClients in Apache 2.2) sets the maximum number of simultaneous requests Apache will serve.
Question 2: In Nginx, which block directive defines a group of backend servers for load balancing?
- server
- proxy_pass
- upstream (Correct answer)
- backend
Correct answer: upstream
The upstream block in Nginx defines a group of servers that can be referenced by proxy_pass for load balancing.
Question 3: Which MySQL command displays the current replication status on a replica server?
- SHOW MASTER STATUS
- SHOW REPLICA STATUS (Correct answer)
- SHOW SLAVE HOSTS
- DESCRIBE REPLICATION
Correct answer: SHOW REPLICA STATUS
SHOW REPLICA STATUS (or SHOW SLAVE STATUS in older versions) displays the current state of the replica's connection to the source.
Question 4: What is the purpose of the Apache mod_status module?
- Log HTTP status codes to syslog
- Provide a real-time server activity page (Correct answer)
- Return custom error pages
- Compress server responses
Correct answer: Provide a real-time server activity page
mod_status exposes a /server-status endpoint showing real-time Apache performance metrics and active connections.
Question 5: Which PostgreSQL command grants all privileges on a database to a user?
- GRANT ALL ON DATABASE dbname TO user (Correct answer)
- ALTER USER user SUPERUSER
- GRANT FULL dbname TO user
- PERMIT ALL ON dbname FOR user
Correct answer: GRANT ALL ON DATABASE dbname TO user
GRANT ALL ON DATABASE dbname TO user gives the specified user all privileges (CREATE, CONNECT, TEMP) on that database.
Question 6: In Apache, which module must be enabled to use .htaccess files for per-directory configuration?
- mod_rewrite (Correct answer)
- mod_auth
- mod_override
- mod_allowoverride
Correct answer: mod_rewrite
While AllowOverride controls whether .htaccess is read, mod_rewrite is the most commonly required module activated via .htaccess; however, AllowOverride must be set to allow .htaccess to function at all.
Question 7: Which command checks the syntax of an Nginx configuration file without restarting the service?
- nginx -s reload
- nginx -t (Correct answer)
- nginx --check
- systemctl verify nginx
Correct answer: nginx -t
nginx -t tests the configuration file for syntax errors and reports the result without affecting the running process.
Which Apache directive controls the maximum number of simultaneous client connections?