For our Blog Visitor only Get Additional 3 Month Free + 10% OFF on TriAnnual Plan YSBLOG10
Grab the Deal

How to Fix cPanel on Linux Server with SSL, Firewall, and License Issues

To fix cPanel on a Linux server, verify the service status, open required ports, restart cPanel/WHM and web services, check logs for errors, repair packages with cPanel scripts, update to the latest build, and resolve SSL, DNS, or license issues. The steps below provide a prioritized, safe workflow any admin can follow.

If your cPanel or WHM panel isn’t loading, returns 500 errors, or services won’t start, this guide shows exactly how to fix cPanel on a Linux server.

Using a proven troubleshooting flow, we’ll help you identify root causes quickly and apply reliable fixes for networking, services, SSL, DNS, licensing, and performance issues.

Quick Diagnosis Checklist

Before deep troubleshooting, confirm these essentials. If one fails, jump to the relevant section below.

  • Can you reach WHM/cPanel over HTTPS (https://server-ip:2087 for WHM, https://server-ip:2083 for cPanel)?
  • Are firewall rules or a cloud security group blocking ports?
  • Do key services run: cpsrvd (cPanel/WHM), httpd or lshttpd, MySQL/MariaDB, named, exim?
  • Any obvious errors in /usr/local/cpanel/logs/error_log, Apache logs, or dmesg?
  • Is the server out of disk space or inodes?
  • Is your cPanel license valid and reachable?

Prerequisites and Safety

  • Root SSH access.
  • Supported OS (AlmaLinux, Rocky Linux, CloudLinux—CentOS Stream 8+ may require care).
  • Make/verify backups before major changes (e.g., EasyApache, PHP handlers, MySQL upgrades).
  • Maintenance window if this is a production server.

Step-by-Step: How to Fix cPanel on Linux Server

1) Confirm and restart core cPanel services

cPanel/WHM runs under the cpsrvd daemon. Use cPanel’s native scripts to check and restart services safely.

# Check cPanel service logs
tail -n 200 /usr/local/cpanel/logs/error_log

# Restart cPanel/WHM (cpsrvd) and watchdog
/scripts/restartsrv_cpsrvd
/scripts/restartsrv_chkservd
/scripts/restartsrv_tailwatchd

# Restart other essentials
/scripts/restartsrv_httpd
/scripts/restartsrv_exim
/scripts/restartsrv_named
/scripts/restartsrv_cphulkd

If cpsrvd won’t stay up, the error_log will typically reveal a certificate, port, or dependency problem.

2) Fix firewall and ports (WHM/cPanel not loading)

cPanel requires specific ports open both on the server firewall and your cloud provider’s security group.

  • WHM: 2087 (SSL), 2086 (non-SSL)
  • cPanel: 2083 (SSL), 2082 (non-SSL)
  • Web/Email/DNS: 80, 443, 25, 465, 587, 110, 995, 143, 993, 53 (TCP/UDP)
  • Licensing/Update: 2089 outbound to cPanel license servers
  • SSH: 22 (or your custom port)
# CSF example: allow common cPanel/WHM ports
csf -a YOUR.PUBLIC.IP      # Temporarily allow your IP (for testing)
csf -u                     # Update firewall
csf -g 2083                # Check if a rule blocks port 2083
# If using firewalld:
firewall-cmd --permanent --add-port=2083/tcp
firewall-cmd --permanent --add-port=2087/tcp
firewall-cmd --reload

Also confirm your cloud firewall (AWS Security Groups, Google VPC, Azure NSG) allows inbound 2083/2087.

3) Repair SSL and AutoSSL issues (cert mismatch/expired cert)

Invalid or expired cPanel service certificates can prevent logins or cause redirects/500 errors.

# Check and reinstall service SSL certificates
/usr/local/cpanel/bin/checkallsslcerts

# Review AutoSSL logs
tail -n 200 /usr/local/cpanel/logs/autossl/*

# Ensure hostname resolves to the server
hostname
dig +short $(hostname) A

Set a valid FQDN that points to the server’s main IP. Then rerun checkallsslcerts to regenerate service certs.

4) Validate DNS and resolvers (panel slow or unreachable)

Broken DNS often manifests as slow panel logins, license failures, or AutoSSL timeouts.

# Check resolvers (should be reachable public DNS servers)
cat /etc/resolv.conf

# Test name resolution and network path
dig cpanel.net
ping -c 3 cpanel.net
traceroute cpanel.net

If resolvers are wrong, replace with reliable ones (e.g., 8.8.8.8, 1.1.1.1), then retry updates and AutoSSL.

5) Fix cPanel license errors

“Invalid License File” or “Cannot read license” indicates connectivity or licensing mismatches.

# Force license update
/usr/local/cpanel/cpkeyclt

# Verify outbound 2089 and DNS resolution to cPanel licensing servers
telnet auth.cpanel.net 2089
dig auth.cpanel.net

Ensure the server’s primary IP matches your licensed IP. Contact your provider to reissue if you changed IPs.

6) Rebuild the web stack with EasyApache 4 (HTTP 500/Service Unavailable)

Bad Apache/Nginx/LSWS or PHP-FPM configs cause 500 errors or blank pages. Use EasyApache 4 to repair.

# Fix and verify Apache
/scripts/restartsrv_httpd
/usr/local/cpanel/scripts/check_cpanel_rpms --fix

# Launch EasyApache 4 in WHM:
# WHM > EasyApache 4 > Provision a known-good profile
# Or via CLI:
/usr/local/bin/ea_update --help

Provision a stable profile (Apache + required PHP versions + PHP-FPM). Rebuild PHP-FPM pools if they fail to start.

7) PHP-FPM, handlers, and module mismatches

If only some sites fail, check domain-level PHP-FPM pools and handler settings.

# Restart PHP-FPM for domains
/scripts/restartsrv_apache_php_fpm

# Review per-domain FPM logs
tail -n 200 /opt/cpanel/ea-php*/root/usr/var/log/php-fpm/error.log

# Switch handlers if needed (WHM > MultiPHP Manager)

Missing extensions (ionCube, imagick, intl) commonly break apps. Add them via EasyApache 4 and restart Apache/PHP-FPM.

8) MySQL/MariaDB connectivity and credentials

Database outages trigger 500 errors and “Error establishing a database connection” in WordPress or apps.

# Check database availability
systemctl status mysql mariadb
journalctl -u mysql -xe --no-pager

# Verify disk space for InnoDB logs/tmp
df -h
df -ih

# Test login
mysql -u root -p

If MySQL is corrupt or won’t start, restore from backup or repair tables. Ensure /tmp is not full and has correct permissions (1777).

9) Disk space, inodes, and permissions

Low disk space or inode exhaustion prevents services from writing PID/log files and causes random failures.

# Check usage
df -h
df -ih

# Find large dirs
du -xhd1 /var | sort -h
du -xhd1 /usr | sort -h

# Clear old logs and caches cautiously
rm -f /var/log/*.gz
journalctl --vacuum-time=7d

Confirm critical paths have correct ownership/permissions: /home, /tmp (1777), /var/tmp (1777), user public_html directories, and /etc/ for configs.

10) Update and repair with cPanel scripts

cPanel provides robust repair utilities. For broken dependencies or outdated builds, a forced update often fixes issues.

# Update cPanel to the latest tier build (Stable/Release/Current)
​/scripts/upcp --force

# Verify and fix RPMs installed by cPanel
/usr/local/cpanel/scripts/check_cpanel_rpms --fix

# Rebuild user domains/Apache config
/scripts/rebuildhttpdconf
/scripts/restartsrv_httpd

Run upcp during off-peak hours. Always keep recent backups before major updates.

11) Security layers: cPHulk, ModSecurity, and SELinux

Over-aggressive security can block logins or requests.

  • cPHulk: Temporarily disable if you’re locked out (WHM > cPHulk Brute Force Protection).
  • ModSecurity: If a site breaks, check audit logs and whitelist needed rules.
  • SELinux: cPanel recommends disabled or permissive on many setups; mismatches can block services.

Common cPanel Errors and Fast Fixes

  • HTTP 500 on WHM/cPanel login: Check /usr/local/cpanel/logs/error_log, repair SSL with checkallsslcerts, run /scripts/restartsrv_cpsrvd, ensure ports 2083/2087 open.
  • “Service Unavailable” on websites: Restart Apache/PHP-FPM, rebuild with EasyApache 4, check PHP memory limits and extensions.
  • “Invalid License File”: Verify outbound 2089, run /usr/local/cpanel/cpkeyclt, ensure IP matches licensed IP.
  • Slow panel after update: Check resolvers, disable failing plugins, run /usr/local/cpanel/scripts/check_cpanel_rpms –fix, confirm disk I/O not saturated (iostat, sar).
  • AutoSSL failing: Ensure hostname A record points to server, rate limits not exceeded, no .htaccess blocks, and that port 80/443 are reachable.

Performance and Hardening Tips

  • Use PHP-FPM per domain and only necessary PHP versions.
  • Enable HTTP/2 and Brotli (if supported) for faster sites.
  • Install CSF + LFD, keep ModSecurity rules current, consider ImunifyAV/Imunify360 for malware protection.
  • Implement off-server backups and test restores regularly.
  • Monitor with chkservd, set alerts to your email or monitoring system.

When to Contact Support

  • You cannot access WHM/cPanel after verifying ports and firewall.
  • cpsrvd or httpd repeatedly crash after updates.
  • License remains invalid despite network and IP checks.
  • Database corruption or filesystem errors (dmesg shows I/O or RAID issues).
  • Security incident suspected (webshells, rootkits, mass defacement).

Have logs ready: /usr/local/cpanel/logs/error_log, /var/log/messages, Apache/PHP-FPM logs, and output from /scripts/upcp. These speed up resolutions significantly.

How YouStable Helps Fix cPanel Faster

As a hosting provider focused on cPanel and Linux, YouStable’s engineers work with these issues daily. Our managed plans include proactive monitoring, firewall tuning, EasyApache and PHP optimization, malware cleanup, and backup strategy—so you spend time on your business, not on panel errors. Need a safe migration to AlmaLinux or CloudLinux? We handle that end-to-end.

Practical Example: A Safe Recovery Workflow

  • Step 1: Open WHM over 2087. If blocked, allow ports in CSF/cloud firewall.
  • Step 2: Restart cpsrvd and check error_log for SSL or dependency errors.
  • Step 3: Run checkallsslcerts to fix service certs if hostname resolves to server IP.
  • Step 4: Rebuild Apache and PHP with EasyApache 4; verify needed extensions.
  • Step 5: Run upcp –force and check_cpanel_rpms –fix for package consistency.
  • Step 6: Validate MySQL/MariaDB and PHP-FPM pools for app-specific errors.
  • Step 7: Confirm disk space/inodes and clean old logs, then retest sites and logins.

FAQs

How do I restart the cPanel/WHM service safely?

Use cPanel’s service scripts: /scripts/restartsrv_cpsrvd to restart the panel, /scripts/restartsrv_chkservd for monitoring, and /scripts/restartsrv_httpd for Apache. Always check /usr/local/cpanel/logs/error_log for clues if the service won’t stay up.

Which ports must be open for cPanel and WHM?

Open 2083 (cPanel SSL) and 2087 (WHM SSL). Also open 80/443 for websites, 53 for DNS, 25/465/587/110/995/143/993 for email, and 2089 outbound for licensing. Ensure both server firewall and cloud security groups allow these ports.

How do I fix a cPanel license error after changing IPs?

Update your license to the new IP with your provider, ensure outbound 2089 and DNS resolution, then run /usr/local/cpanel/cpkeyclt. If it still fails, check resolvers in /etc/resolv.conf and confirm the server can reach auth.cpanel.net.

How can I rebuild Apache/PHP if sites show 500 errors?

In WHM, open EasyApache 4 and provision a stable profile with the required PHP versions and extensions. Then restart Apache and PHP-FPM. If problems persist, run /usr/local/cpanel/scripts/check_cpanel_rpms –fix to repair packages.

What’s the safest way to update cPanel?

Back up first, schedule a maintenance window, then run /scripts/upcp –force. Choose the Stable or Release tier in WHM to minimize risk. After updating, verify key services and test WHM/cPanel logins and a few representative websites.

Deepika Verma

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top