Last Updated on 2 months by Sachin G
Apache is one of the most widely used web server everywhere with cPanel Hosting Panel , so it is easy to manage for web hosting . I recently did a fresh installation of cPanel and hosted a couple of websites on my VPS server. After some time, or following a reboot, I noticed that my websites were not coming online. The issue was that Apache wasn’t working, and I received the error “Failed to start Apache webserver managed by cPanel EasyApache .”
However, encountering the worry about “Failed to start Apache” error was be frustrating, especially when your sites go down. I diagnose and fix the issue . The steps may help you whether you are new to server management or an experienced system administrator. it can help your get web server back up and running.
Several reasons can cause to fail on a cPanel-managed server. It can be configuration issue, port conflicting, corrupt or missing files etc . So first check my Apache-service status .
Check Apache Status
The first step when Apache fails is to check its current status. You can do this by running the following command:
sudo systemctl status httpd
This above will provide an overview of status and any error messages. If there’s an issue, it will often give a clue to what went wrong.In my case the services was failed and i also checked error log /var/log/apache2/error_log but their is also nothing except only written apache is managed by cpanel easy-apache.
root@cpanel [~]# systemctl status httpd.service -l httpd.service - Apache webserver managed by cPanel EasyApache Loaded: loaded (/etc/systemd/system/httpd.service; enabled) Active: failed (Result: exit-code) since Thu 2015-09-24 08:24:20 UTC; 49s ago Process: 17066 ExecStart=/usr/local/cpanel/scripts/restartsrv_httpd --no-verbose (code=exited, status=1/FAILURE) Sep 24 08:24:20 cpanel.techtransit.org systemd[1]: Starting Apache webserver managed by cPanel EasyApache... Sep 24 08:24:20 cpanel.techtransit.org restartsrv_httpd[17066]: httpd: Syntax error on line 30 of /usr/local/apache/conf/httpd.conf: Cannot load modules/mod_bwlimited.so into server: /usr/local/apache/modules/mod_bwlimited.so: cannot open shared object file: No such file or directory Sep 24 08:24:20 cpanel.techtransit.org systemd[1]: httpd.service: control process exited, code=exited status=1 Sep 24 08:24:20 cpanel.techtransit.org systemd[1]: Failed to start Apache webserver managed by cPanel EasyApache. Sep 24 08:24:20 cpanel.techtransit.org systemd[1]: Unit httpd.service entered failed state.
Causes of Apache Startup Failure :
I checked about error but my module was showing properly and not really seen any syntax error there. Common errors include configuration file issues, memory limitations, and port conflicts can be seen in error logs , but i got nothing , i checked Apache config test and it was successful.
So i felt something or some related module or file in Apache is missing , So first i decided to go rebuild Apache configuration using easyapache and restart cpanel Apache service .
1. Rebuild Apache Configuration Using EasyApache
If you suspect that your configuration files are corrupted or missing some module etc , you can rebuild them using EasyApache, it is built-in tool for managing Apache and PHP configurations.
Run the following command to initiate to rebuild services or i am attaching screenshot through graphical you can do by WHM Control Panel.
sudo /scripts/easyapache --build
OR Through control panel steps is below.
- Access your WHM panel by navigating to
https://your-server-ip:2087
in your browser. Log in with your root credentials. - In the WHM search bar on the left, select EasyApache from the search results.
- Once open in the EasyApache interface, click on Customize next to the currently active profile.
- Select Apache , PHP Versions and review additional packages.
- Once you’ve done your selections, click Review . If everything looks correct, click Provision to start rebuilding EasyApache
- Wait for sometime to the Process to Complete .
- After that you can restart the service via Home > Restart Services > HTTP Server (Apache) and clicking Restart.
It will take time to finish build .After that you check apache running status.
2. Restart cPanel Apache Service
Below command performs a clean restart of Apache service . You can use this command if a service won’t restart from WHM. Sometimes, restarting service can resolve Apache issues. You can restart all cPanel services with the following command:
sudo /scripts/restartsrv_httpd
By following these steps, i successfully rebuild Easy Apache using the WHM panel allowing you to update or modify your Apache and PHP configurations with ease.
I am a professional freelance contributor and the founder of Tech Transit. I hold certifications in Linux, Ansible, and OpenShift from Red Hat, as well as CPanel and ITIL certifications. With a passion for education, culture, and community, I love writing and sharing knowledge. Since 2009, I’ve been actively using, setting up, supporting, and maintaining Linux systems. Linux truly rocks!