An EasyApache 4 rebuild that fails halfway is more disruptive than most cPanel operations because it touches the web server itself. The server is left with packages partially upgraded, vhost includes that reference modules that no longer exist, and httpd refusing to start. Recovery has a specific order: roll back to a known-good profile first, then investigate what made the rebuild fail.
What’s happening
EasyApache 4 changes Apache, the PHP versions installed, the MPM, and the loaded modules in one transactional pass — when it works. When it fails partway (out of disk, a yum lock, a custom module package missing from the repo), the package state is half-converted. cPanel’s WHM > EasyApache 4 keeps a “Previously saved configuration” snapshot which is the fastest rollback. Manual recovery is possible but slower.
How to verify
Confirm what state the server is in:
# is Apache running at all?
systemctl status httpd
# config test
apachectl configtest
apachectl -V
# what PHP versions are installed?
ls /opt/cpanel/ | grep ea-php
# loaded modules vs available modules
httpd -M 2>&1
# EasyApache 4 history
ls /etc/cpanel/ea4/profiles/custom/
# yum/dnf transaction state
yum history list | head
The most informative log:
tail -200 /usr/local/cpanel/logs/easy/apache/build.log
The fix
- Roll back via the saved profile — WHM > EasyApache 4 > Previously Saved Configurations. Click “Provision” on the last known-good profile. EA4 will reinstall the previous package set.
- If the UI is broken —
yum history listshows recent transactions.yum history undo <id>rolls back the offending transaction. Then/scripts/restartsrv_httpd. - Vhost include cleanup — after a rollback, vhost includes referencing modules that were briefly added during the failed rebuild can persist.
find /etc/apache2/conf.d/userdata -name "*.conf" -exec grep -l "<missing-module>" {} \;and remove the offenders. - PHP-FPM pool config drift — if PHP versions were swapped, FPM pool files for the removed version remain.
ls /opt/cpanel/ea-php*/root/etc/php-fpm.d/. Remove orphaned pools, restart FPM. - Validate before declaring done —
apachectl configtest,httpd -M,curl -I https://example.com, and a real page load for each major application. A rebuild that “succeeded” but breaks one CMS is the same as a failed rebuild.
The right time to fix an EasyApache profile is on a staging clone of the host. Stack Harbor handles EA4 rebuilds with rollback rehearsal under managed cPanel operations — start a conversation before the next major PHP version swap.