DEV Community

Sovrab Roy
Sovrab Roy

Posted on

How I Recovered a Crashed WHM/cPanel Server and Restored Websites

How I Recovered a Crashed WHM/cPanel Server and Restored Websites

A few days ago, a client contacted me because all websites hosted on their WHM/cPanel server suddenly went offline.

The server was running on a Linux VPS with WHM/cPanel installed. Multiple websites were down, email services were not responding, and the client was concerned about potential data loss.

In this article, I'll walk through the troubleshooting and recovery process I used.

Step 1: Verify Server Accessibility

First, I checked whether the server was reachable via SSH.

ssh root@server-ip
Enter fullscreen mode Exit fullscreen mode

The server was accessible, which meant the VPS itself was still running.

I then checked the system load and uptime:

uptime
top
Enter fullscreen mode Exit fullscreen mode

This helped identify whether the server was overloaded or suffering from resource exhaustion.

Step 2: Check Disk Usage

One of the most common causes of service failures on cPanel servers is a full disk.

df -h
Enter fullscreen mode Exit fullscreen mode

In this case, disk usage was critically high.

To locate large files:

du -sh /var/* | sort -h
Enter fullscreen mode Exit fullscreen mode

After identifying unnecessary log growth, old logs were cleaned safely.

Step 3: Verify Core Services

Next, I checked the status of essential services.

systemctl status httpd
systemctl status mysql
systemctl status named
systemctl status exim
Enter fullscreen mode Exit fullscreen mode

Apache was not running correctly.

To restart services:

systemctl restart httpd
systemctl restart mysql
Enter fullscreen mode Exit fullscreen mode

Step 4: Review Error Logs

Logs provide the real story.

Apache errors:

tail -100 /usr/local/apache/logs/error_log
Enter fullscreen mode Exit fullscreen mode

System messages:

tail -100 /var/log/messages
Enter fullscreen mode Exit fullscreen mode

These logs revealed configuration issues that prevented Apache from starting.

Step 5: Validate Apache Configuration

Before restarting production services, configuration should always be validated.

apachectl configtest
Enter fullscreen mode Exit fullscreen mode

Output:

Syntax OK
Enter fullscreen mode Exit fullscreen mode

After verification:

systemctl restart httpd
Enter fullscreen mode Exit fullscreen mode

Websites started loading again.

Step 6: Verify MySQL Health

Database availability is critical for WordPress and dynamic websites.

systemctl status mysql
mysqladmin ping
Enter fullscreen mode Exit fullscreen mode

Database services were functioning normally after recovery.

Step 7: Check cPanel Services

To ensure WHM and cPanel services were healthy:

/usr/local/cpanel/scripts/restartsrv_cpsrvd
Enter fullscreen mode Exit fullscreen mode

Verify service status:

service cpanel status
Enter fullscreen mode Exit fullscreen mode

Step 8: Validate DNS and Email Services

DNS:

systemctl status named
Enter fullscreen mode Exit fullscreen mode

Email:

systemctl status exim
Enter fullscreen mode Exit fullscreen mode

All services were tested and confirmed operational.

Final Verification

After restoring services:

  • Websites were accessible
  • WHM login worked
  • cPanel accounts loaded correctly
  • Email delivery was functioning
  • DNS resolution was successful

Conclusion

Server recovery is rarely about running a single command. The key is following a structured troubleshooting process:

  1. Verify server access
  2. Check disk space
  3. Review service status
  4. Analyze logs
  5. Validate configurations
  6. Restore services safely

By following a systematic approach, I was able to recover the crashed WHM/cPanel server and restore all hosted websites with minimal downtime.

Have you ever dealt with a production server outage? Share your experience in the comments.

Top comments (0)