Did apache2 fail to start? Do you have eaccelerator installed? Did you recently upgrade php5? If so, I may have the answer to your problem.
It all started when I upgraded some packages on a Ubuntu server through Webmin. I think one of the packages was php5.
Anyhow, seeing that I upgraded packages related to Apache2, I restarted the apache2 service. It was then that I was met with the following error message:
Failed to start apache :
* Starting web server apache2
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
So it seems that apache2 couldn't start because the address was already in use.
Believing that the error might have been a result from starting apache2 from Webmin, I opened up a console window and tried to start apache2 from the command line with
sudo /etc/init.d/apache2 restart
Still, apache2 didn't start and I was shown the following error message:
* Restarting web server apache2
httpd (no pid file) not running
What seemed kind of odd though, was that when I ran the top command, it showed that the apache2 process was running and using 100% of cpu.
The next place to turn was apache's error logs located at
The error log showed the following message that indicated eaccelerator might have been related to the problem of apache2 not starting:
PHP Warning: [eAccelerator] This build of "eAccelerator" was compiled for PHP version 5.2.4-2ubuntu5.3. Rebuild it for your PHP version (5.2.4-2ubuntu5.4) or download precompiled binaries.\n in Unknown on line 0
PHP Fatal error: Unable to start eAccelerator module in Unknown on line 0
A little google searching showed me that eAccelerator wasn't working because it's not compiled for my newly upgraded version of php5.
To remedy the situation, or at least to confirm whether or not eaccelerator was the problem, I renamed the eaccelerator.ini file stored in
1. /etc/php5/apache2/conf.d to something else and then started apache2.
Apache started up as if there was never any problem. It was eaccelerator keeping apache from starting.
Apache2 worked as long as eaccelerator wasn't active. Now all I'll need to do if I want to continue using eaccelerator is to recompile eaccelerator so that it is compatible with my upgraded version of php5.