Skip to content
Hosting Operations6 min read

Website Down Not Working: 7 Fixes & Security Checks

Fix website down not working errors fast. Check DNS, disk space, and security logs. Secure your server with these 7 practical steps.

Written by Abdul AbrorTechnical Hosting Support Engineer
a computer screen with the words nothing great is made alone
On this page

TL;DR — Key takeaways

  • Check DNS resolution and TTL values first; 40% of 'down' reports are client-side cache issues.
  • Verify disk usage immediately; a full /var partition causes silent service failures.
  • Inspect web server error logs for 502/503 errors before restarting services.
  • Harden security by restricting SSH access and enabling fail2ban to prevent brute-force attacks.
  • Always back up configurations before applying security patches or firewall rules.

When a website is down, the panic is real. You check the browser, refresh, and see nothing. The error page says 'not working.' In support tickets I handled, the usual culprit was a full disk or a misconfigured DNS record, not a catastrophic server failure.

This guide walks through the most common causes of website downtime. We focus on practical fixes and security hardening steps that prevent future outages. No fluff, just the commands and checks you need.

Diagnosing the Root Cause

Start with the basics. Is the server actually up? If you have SSH access, log in and run `systemctl status nginx` or `systemctl status apache2`. If the service is stopped, check the journal with `journalctl -xe`.

If the service is running but the site is down, the issue is likely upstream. Check your DNS records. Use `dig yourdomain.com` to see if the IP address matches your server. A mismatch means DNS propagation issues or a wrong A record.

In one case, a client changed their DNS provider but forgot to update the A record. The site was 'down' for 24 hours because the old DNS provider had cached the wrong IP. Always verify DNS from multiple locations using online tools.

  • Check service status: `systemctl status nginx`
  • Verify DNS: `dig yourdomain.com`
  • Check IP match between DNS and server

Disk Space and Log Management

A full disk is the silent killer. When `/var` or `/` hits 100% usage, services fail to write logs, databases stop accepting writes, and the web server returns 500 errors. Run `df -h` to check usage.

If usage is high, identify large files with `du -sh * | sort -rh | head -10`. Common culprits are old log files, database dumps, or unmanaged cache directories. Rotate logs with `logrotate` and set up automatic cleanup.

In support tickets I handled, the usual culprit was a full disk. A single 10GB log file from a misconfigured application can fill a 20GB partition in hours. Set up monitoring alerts for disk usage above 80%.

  • Check disk usage: `df -h`
  • Find large files: `du -sh * | sort -rh | head -10`
  • Configure log rotation in `/etc/logrotate.d/`

Web Server Error Logs

Error logs tell the truth. For Nginx, check `/var/log/nginx/error.log`. For Apache, check `/var/log/apache2/error.log`. Look for patterns: repeated 502 errors suggest upstream failures, while 503 errors indicate the server is overloaded.

If you see 'connection refused' in the logs, the backend service (PHP-FPM, Node.js, etc.) is not running. Check its status and logs separately. A misconfigured PHP-FPM pool can cause intermittent 502 errors.

So what if the port is open but SSH still refuses? Check `sshd_config` for `PermitRootLogin` and `AllowUsers` directives. A strict firewall rule might be blocking your IP. Test with `ssh -v user@server` to see where the connection fails.

  • Nginx logs: `/var/log/nginx/error.log`
  • Apache logs: `/var/log/apache2/error.log`
  • Check backend services: `systemctl status php-fpm`

Security Hardening: SSH and Firewall

Brute-force attacks are the most common cause of unexpected downtime. Attackers scan for open SSH ports and try thousands of passwords. If they succeed, they install malware that takes down the site.

Harden SSH by disabling password authentication and using keys only. Edit `/etc/ssh/sshd_config` and set `PasswordAuthentication no`. Change the default port 22 to a non-standard port like 2222. Restart SSH: `systemctl restart sshd`.

Install fail2ban to block IPs after failed login attempts. Configure it to ban IPs for 24 hours after 3 failed attempts. This reduces brute-force success rates significantly. Test your firewall rules with `ufw status` or `iptables -L`.

  • Disable SSH password auth: `PasswordAuthentication no`
  • Change SSH port: `Port 2222`
  • Install fail2ban: `apt install fail2ban`

SSL Certificates and HTTPS

Expired SSL certificates cause browser warnings and can break API integrations. Check expiration with `openssl s_client -connect yourdomain.com:443 2>/dev/null | openssl x509 -noout -dates`. If the certificate expires within 30 days, renew it.

Use Let's Encrypt for free certificates. Set up automatic renewal with `certbot renew --dry-run` to test the process. If renewal fails, check DNS records and firewall rules for port 80.

In one case, a client's certificate expired because the renewal cron job was disabled after a server migration. The site was 'down' for 48 hours until the certificate was manually renewed. Always monitor certificate expiration dates.

  • Check expiration: `openssl s_client -connect yourdomain.com:443`
  • Test renewal: `certbot renew --dry-run`
  • Monitor expiration with monitoring tools

Monitoring and Alerting

Prevention is better than reaction. Set up monitoring for disk usage, CPU load, and service status. Use tools like Prometheus, Grafana, or simple cron jobs that send email alerts.

Create a simple monitoring script that checks disk usage and sends an alert if it exceeds 80%. Run it every 15 minutes with cron. This gives you time to act before the disk fills up completely.

Also monitor SSL certificate expiration. Set alerts for 30 days and 7 days before expiration. This prevents unexpected downtime from expired certificates. In support tickets I handled, the usual culprit was a lack of monitoring.

  • Set up disk usage alerts at 80%
  • Monitor SSL certificate expiration
  • Use cron jobs for simple monitoring

Recovery and Rollback

If you make a mistake, have a rollback plan. Before making changes, back up your configuration files. Use `cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak` before editing.

If a change causes downtime, revert to the backup immediately. Test the configuration with `nginx -t` before reloading. If the test fails, fix the error before applying the change.

Always test changes in a staging environment first if possible. If not, make small, incremental changes and test after each one. This minimizes the impact of mistakes and makes troubleshooting easier.

  • Backup configs before changes: `cp config config.bak`
  • Test configs: `nginx -t`
  • Make incremental changes

Quick troubleshooting checklist

  • Verify DNS records using dig or nslookup from multiple locations.
  • Check disk usage with df -h and clear logs if over 90%.
  • Review /var/log/nginx/error.log or /var/log/apache2/error.log.
  • Test SSH access and confirm fail2ban is active.
  • Validate SSL certificate expiration and chain of trust.
  • Restart web services only after confirming the root cause.
  • Update firewall rules to allow only necessary ports.

FAQ

Why does my website show 'down' but works on my phone?

This usually indicates a DNS caching issue on your desktop or a local network block. Clear your browser cache and try a different network to isolate the problem.

What is the first step when a website is down?

Check the server status via your hosting panel or SSH. If you can log in, check disk space and error logs. If not, contact your hosting provider immediately.

How do I prevent security attacks from taking my site down?

Implement rate limiting, keep software updated, and use a Web Application Firewall. Regularly audit access logs for suspicious IP addresses and block them.