Skip to content
Hosting Operations5 min read

Website Down? 7 Security Fixes That Actually Work

Stop recurring website down errors by hardening your server. Fix DNS, SSL, and firewall misconfigurations with these 7 verified steps.

Written by Abdul AbrorTechnical Hosting Support Engineer
A blue laptop displaying the WordPress logo on a speckled blue surface
On this page

TL;DR — Key takeaways

  • Check DNS propagation and SSL certificate validity before assuming server failure.
  • A full disk or exhausted memory usually causes silent website down states rather than explicit errors.
  • Verify firewall rules allow HTTP/HTTPS traffic to prevent external access blocks.
  • Review web server logs for 502/503 errors to identify upstream process crashes.
  • Implement automated backups to enable rapid rollback after failed configuration changes.

When a site goes dark, the first instinct is to restart the server. That rarely helps. In support tickets I handled, the usual culprit was a full disk or a misconfigured firewall, not a crashed kernel.

This guide walks through the security-hardening steps that prevent most website down scenarios. You will learn how to audit your infrastructure, identify the root cause, and verify the fix without breaking production.

Threat Model: What Actually Takes Sites Down

Most outages stem from resource exhaustion or configuration drift. A slow database query can fill up the connection pool. A misconfigured cron job can consume 100% CPU. These are not security breaches, but they look identical to a DDoS attack from the outside.

Security hardening reduces the attack surface, but it also introduces failure points. A strict firewall rule might block legitimate traffic. An overly restrictive SELinux policy can prevent the web server from reading files. You need to understand these tradeoffs before applying changes.

  • Resource exhaustion: CPU, memory, or disk space limits reached.
  • Configuration drift: Changes made manually without version control.
  • Security misconfiguration: Firewall or SELinux rules blocking valid traffic.
  • Dependency failure: Database or cache service crashes.

Audit Checklist: Verify Your Current State

Before changing anything, establish a baseline. Run these commands to capture the current state of your server. Save the output to a file for comparison after fixes.

Check disk usage first. A full disk is the most common cause of silent failures. The web server may still run, but it cannot write logs or session data.

  • df -h to check disk space.
  • free -m to check memory usage.
  • systemctl status nginx (or apache) to check service status.
  • tail -n 50 /var/log/nginx/error.log to review recent errors.
  • dig example.com to verify DNS resolution.

Hardening Step 1: Secure DNS and SSL

DNS issues are invisible to the server but fatal to users. If the A record points to the wrong IP, no amount of server tuning will help. Verify that the DNS record matches the server's public IP.

SSL certificates expire. An expired cert causes browsers to block the site entirely. Check the expiration date and the chain of trust. A missing intermediate certificate is a common cause of 'not secure' warnings.

  • Verify A/AAAA records match the server IP.
  • Check SSL certificate expiration date.
  • Validate the certificate chain using openssl s_client.
  • Ensure HSTS header is set if using HTTPS.

Hardening Step 2: Firewall and SELinux

Firewalls are the first line of defense, but they are also the most common cause of 'website down' for external users. If you recently added a rule, you might have blocked port 80 or 443. Test from an external IP to confirm.

SELinux runs in enforcing mode on most modern distributions. If you changed file permissions or moved files, SELinux might deny access. Check the audit log for denials and adjust the context if needed.

  • Verify iptables/nftables rules allow ports 80 and 443.
  • Check SELinux status with getenforce.
  • Review /var/log/audit/audit.log for denials.
  • Test external access with curl -I https://example.com.

Hardening Step 3: Web Server Configuration

The web server configuration is where most performance issues hide. A misconfigured worker process can exhaust memory. A missing timeout setting can cause 502 errors under load. Review the configuration file for obvious mistakes.

Enable keepalive connections to reduce overhead. Set appropriate timeouts for upstream services. If you use a reverse proxy, ensure the proxy timeout is longer than the backend timeout.

  • Review worker_processes and worker_connections settings.
  • Set proxy_read_timeout to match backend response times.
  • Enable gzip compression for text-based assets.
  • Configure error pages for 404, 500, and 502 errors.

Verification: Confirm the Fix

Do not assume the fix worked. Test from multiple locations. Use an external service to check uptime and SSL validity. Verify that the response headers are correct and the content is served as expected.

Monitor the server for 24 hours after the fix. Resource usage might spike later. Set up alerts for disk space, memory, and error rates to catch regressions early.

  • Test from an external IP address.
  • Verify SSL certificate validity with an online checker.
  • Monitor CPU and memory usage for 24 hours.
  • Review error logs for new entries after the fix.

Rollback and Backup Strategy

Every change carries risk. Before applying hardening steps, take a snapshot of your configuration files. If something breaks, you need a way to revert quickly.

Use version control for configuration files. Commit changes with descriptive messages. This allows you to diff configurations and identify what changed between a working state and a broken one.

  • Backup /etc/nginx/ or /etc/apache2/ before changes.
  • Use git to track configuration file changes.
  • Test changes in a staging environment first.
  • Document the rollback procedure for each step.

Quick troubleshooting checklist

  • Verify DNS records resolve correctly using dig or nslookup.
  • Check SSL certificate expiration and chain of trust.
  • Inspect disk space and memory usage on the server.
  • Review web server error logs for recent crashes.
  • Confirm firewall rules permit inbound traffic on ports 80 and 443.
  • Test local server response using curl from the host machine.
  • Validate that the web server service is active and running.

FAQ

Why is my website down but the server is online?

The web server process may have crashed, the disk is full, or a firewall rule is blocking external traffic. Check the service status and error logs first.

How do I fix a website down error caused by SSL?

Verify the certificate is not expired and the chain is complete. Regenerate the certificate if needed and restart the web server to apply changes.

What should I check first when a website is down?

Start with DNS resolution and SSL validity. These are the most common causes of external inaccessibility and are quick to verify.