Lesson 4: The Wire Inspector (Ports & HTTP)
Every server has thousands of ports — think of them as numbered doors. A web server listens on port 80 (HTTP) or 443 (HTTPS). A database might use port 5432 (PostgreSQL). As a DevOps engineer, you must know which doors are open.
Understanding Ports
- Port 22 — SSH (remote login)
- Port 80 — HTTP (web traffic)
- Port 443 — HTTPS (secure web traffic)
- Port 3000 — Common for development servers (Node.js, etc.)
- Port 5432 — PostgreSQL database
Inspecting Open Ports: ss
The ss command (Socket Statistics) replaced the older netstat. It shows which ports are open and which programs are using them.
ss -tlnp
-t— Show TCP connections.-l— Show only listening (open) ports.-n— Show port numbers (not service names).-p— Show which process is using each port.
Deep Dive with curl
curl is the Swiss Army knife of HTTP. You can use it to test APIs, download files, and debug web services.
curl -s https://httpbin.org/ip # Simple GET request
curl -I https://google.com # View response headers only
curl -X POST -d '{"key":"value"}' # Send POST data
DNS Lookup: nslookup
Every domain name (like google.com) maps to an IP address. nslookup reveals this mapping.
booting...
Mission Objective
A deployment just happened. Verify the server is properly configured:
- Check the doors: Run
ss -tlnpto see which ports are open. - Test the web: Use
curl -s https://httpbin.org/ipto verify internet access and see your public IP. - Resolve a domain: Run
nslookup google.comto check DNS resolution.