Mitranno, when something breaks, ghabru naka (don't panic). Work through the list from outside to inside — most problems are found in the first few steps.
A.1 Cannot SSH into the instance
Check
How
Instance is running and status checks 2/2
EC2 console
Correct public IP (changes after stop/start)
Console → Instance → Public IPv4
Security group allows TCP 22 from your current IP (mobile hotspot / college Wi-Fi IPs change!)
Website/SSH broken after stop/start or type change
Public IP changed — attach an Elastic IP (Chapter 14)
Time zone wrong in logs
sudo timedatectl set-timezone Asia/Kolkata
A.5 Web-server configuration and domains
Symptom
Check / fix
403 after changing root / DocumentRoot
namei -l <file> (755 dirs, 644 files); matching <Directory> with Require all granted; CentOS SELinux: ls -Z, semanage fcontext -a -t httpd_sys_content_t "/path(/.*)?" + restorecon -Rv; never serve from home folders
New port not reachable
sudo ss -tlnp (listening?); security group inbound rule; firewall-cmd --add-port=PORT/tcp; CentOS: semanage port -a -t http_port_t -p tcp PORT (service fails with Permission denied otherwise)
Domain not resolving
dig example.com +short and dig @8.8.8.8 example.com; record name typo (blog, not blog.example.com); dig NS example.com — editing records at the wrong DNS host?; domain verified and not expired?; wait for TTL / flush local cache
Default site shows instead of your vhost
server_name / ServerName + ServerAlias include the exact name?; Ubuntu: remove sites-enabled/default or a2dissite 000-default.conf; Nginx default_server elsewhere; inspect sudo nginx -T / sudo apachectl -S; forgot reload?
Domain resolves but page times out
Security group 80/443; DNS points to the right Elastic IP?; curl -I http://EIP -H "Host: example.com"