Stage 5: Deep‑Dive Legend
Consolidate all deep‑dive knowledge by configuring and running a web server. Learners practice permissions, kernel awareness, configs, networking, and services in one integrated challenge - exactly the kind of scenario interviewers love to test.
Hackbook Overview
- Web Server Setup: Common servers include Apache (
httpd) and Nginx. - Configuration Files: Located in
/etc/httpd/or/etc/nginx/. - Permissions: Ensure correct ownership for web directories (
/var/www/html). - Networking: Open port 80/443 for HTTP/HTTPS traffic.
- Service Management: Start, stop, and enable the web server with
systemctl. - Why It Matters: Demonstrates ability to integrate multiple Linux skills into a practical, interview‑ready scenario.
Hands‑On Practice
- Install Nginx:
sudo apt install nginx(Debian/Ubuntu) orsudo yum install nginx(RHEL/CentOS). - Start service:
sudo systemctl start nginx. - Enable service on boot:
sudo systemctl enable nginx. - Verify service:
systemctl status nginx. - Test locally:
curl http://localhost. - Edit default config:
/etc/nginx/nginx.confand reload withsudo systemctl reload nginx. - Adjust firewall:
sudo firewall-cmd --add-service=http.
Interview Question Bank
Conceptual
- Q1. What are common Linux web servers?
A1. Apache (httpd) and Nginx are the most widely used. - Q2. Where are web server configuration files stored?
A2. Typically under/etc/httpd/for Apache and/etc/nginx/for Nginx. - Q3. Why do permissions matter for web directories?
A3. Incorrect permissions can prevent the server from serving files or expose security risks.
Practical
- Q5. How do you test if a web server is running locally?
A5. Runcurl http://localhostor openhttp://127.0.0.1in a browser. - Q6. How do you reload a web server after config changes?
A6. Runsudo systemctl reload nginxorsudo systemctl reload httpd.
Q4. How do you start and enable Nginx on boot?
A4.bash
sudo systemctl start nginx
sudo systemctl enable nginx
Scenario‑Based
- Q7. A web server is running but inaccessible externally. What do you check?
A7. Verify firewall rules (firewall-cmd --list-all), confirm port 80/443 is open, and check service status. - Q8. You edited the config file and the server won’t start. How do you troubleshoot?
A8. Check syntax withnginx -torapachectl configtest, then review logs in/var/log/nginx/or/var/log/httpd/. - Q9. How do you secure a web server with HTTPS?
A9. Install SSL certificates (e.g., via Let’s Encrypt) and configure them in/etc/nginx/sites-enabled/or Apache’sssl.conf.
Behavioral Based
- Q10. Tell me about a time you configured a service end‑to‑end.
A10. Example: “I set up Nginx on a test server, configured firewall rules, and deployed a static site, which gave me confidence in managing services independently.”
Cheatsheet (Quick Notes)
- Install:
apt install nginx/yum install nginx. - Service:
systemctl start|enable|reload nginx. - Config Files:
/etc/nginx/nginx.conf,/etc/httpd/httpd.conf. - Firewall:
firewall-cmd --add-service=http. - Logs:
/var/log/nginx/,/var/log/httpd/.

Updated on Dec 21, 2025