Apache httpd restart gets NamedVirtualHost error

I have had Apache stop working a couple of times a day. Same error message if I try to restart apache:

[Thu Jul 10 15:19:07 2014] [notice] child pid 1725 exit signal Aborted (6)
[Thu Jul 10 15:23:45 2014] [warn] mod_fcgid: cleanup zombie process 15683
[Thu Jul 10 15:26:55 2014] [error] mod_fcgid: fcgid process manager died, restarting the server
[Thu Jul 10 15:26:57 2014] [notice] SIGHUP received. Attempting to restart
[Thu Jul 10 15:26:57 2014] [warn] NameVirtualHost 2607:f208:50e:3150::2:80 has no VirtualHosts
[Thu Jul 10 15:26:57 2014] [warn] NameVirtualHost 2607:f208:50e:3150::5:80 has no VirtualHosts
[Thu Jul 10 15:26:57 2014] [warn] NameVirtualHost 2607:f208:50e:3150::b:80 has no VirtualHosts
[Thu Jul 10 15:26:57 2014] [warn] NameVirtualHost 2607:f208:50e:3150::c:80 has no VirtualHosts
[Thu Jul 10 15:26:57 2014] [warn] NameVirtualHost 2607:f208:50e:3150::f:80 has no VirtualHosts
[Thu Jul 10 15:26:57 2014] [warn] NameVirtualHost 2607:f208:50e:3150::f:443 has no VirtualHosts
[Thu Jul 10 15:26:57 2014] [warn] NameVirtualHost 2607:f208:050e:3150:0000:0000:0000:21:80 has no VirtualHosts
[Thu Jul 10 15:26:57 2014] [warn] NameVirtualHost 2607:f208:050e:3150:0000:0000:0000:22:80 has no VirtualHosts
[Thu Jul 10 15:26:57 2014] [warn] NameVirtualHost 2607:f208:050e:3150:0000:0000:0000:23:80 has no VirtualHosts
[Thu Jul 10 15:26:57 2014] [warn] NameVirtualHost *:0 has no VirtualHosts
[Thu Jul 10 15:26:57 2014] [notice] Digest: generating secret for digest authentication …
[Thu Jul 10 15:26:57 2014] [notice] Digest: done
[Thu Jul 10 15:26:57 2014] [warn] Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Thu Jul 10 15:26:57 2014] [notice] Apache/2.2.15 (Unix) DAV/2 mod_fcgid/2.3.9 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.0-fips SVN/1.6.11 mod_perl/2.0.4 Perl/v5.10.1 configured – resuming normal operations

Apache does NOT restart

Doing a manual restart - I get the same error messages and apache will not start. To get the service to strat I must go:
[root@ip-68-178-130-21 ~]# killall -9 httpd
[root@ip-68-178-130-21 ~]# service httpd start
Starting httpd: [Thu Jul 10 16:14:08 2014] [warn] NameVirtualHost 2607:f208:50e:3150::2:80 has no VirtualHosts
[Thu Jul 10 16:14:08 2014] [warn] NameVirtualHost 2607:f208:50e:3150::5:80 has no VirtualHosts
[Thu Jul 10 16:14:08 2014] [warn] NameVirtualHost 2607:f208:50e:3150::b:80 has no VirtualHosts
[Thu Jul 10 16:14:08 2014] [warn] NameVirtualHost 2607:f208:50e:3150::c:80 has no VirtualHosts
[Thu Jul 10 16:14:08 2014] [warn] NameVirtualHost 2607:f208:50e:3150::f:80 has no VirtualHosts
[Thu Jul 10 16:14:08 2014] [warn] NameVirtualHost 2607:f208:50e:3150::f:443 has no VirtualHosts
[Thu Jul 10 16:14:08 2014] [warn] NameVirtualHost 2607:f208:050e:3150:0000:0000:0000:21:80 has no VirtualHosts
[Thu Jul 10 16:14:08 2014] [warn] NameVirtualHost 2607:f208:050e:3150:0000:0000:0000:22:80 has no VirtualHosts
[Thu Jul 10 16:14:08 2014] [warn] NameVirtualHost 2607:f208:050e:3150:0000:0000:0000:23:80 has no VirtualHosts
[Thu Jul 10 16:14:08 2014] [warn] NameVirtualHost *:0 has no VirtualHosts
[ OK ]
[root@ip-68-178-130-21 ~]# service httpd status
httpd (pid 1806) is running…

Still get these warnings. Before the service failed I did notice that there were a lot of /usr/sbin/httpd commands with a memory size of about 450mb each. At one stage there were dozens, but the pid shows it as ended.

Andy I have included the beancounter that was captured after apache stopped and before I restarted.

Version: 2.5
uid resource held maxheld barrier limit failcnt
10086860: kmemsize 72831054 75282395 9223372036854775807 9223372036854775807 0
lockedpages 0 0 9223372036854775807 9223372036854775807 0
privvmpages 480761 538398 1572864 1572864 0
shmpages 1206 1206 9223372036854775807 9223372036854775807 0
dummy 0 0 9223372036854775807 9223372036854775807 0
numproc 145 147 32567 32567 0
physpages 222736 279237 9223372036854775807 9223372036854775807 0
vmguarpages 0 0 786432 9223372036854775807 0
oomguarpages 222737 279238 9223372036854775807 9223372036854775807 0
numtcpsock 52 55 9223372036854775807 9223372036854775807 0
numflock 115 117 9223372036854775807 9223372036854775807 0
numpty 1 1 255 255 0
numsiginfo 1 1 1024 1024 0
tcpsndbuf 2995104 3058816 9223372036854775807 9223372036854775807 0
tcprcvbuf 851968 901120 9223372036854775807 9223372036854775807 0
othersockbuf 302080 506880 9223372036854775807 9223372036854775807 0
dgramrcvbuf 0 8480 9223372036854775807 9223372036854775807 0
numothersock 169 175 9223372036854775807 9223372036854775807 0
dcachesize 2647881 2730513 9223372036854775807 9223372036854775807 0
numfile 22748 23421 9223372036854775807 9223372036854775807 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
numiptent 41 41 9223372036854775807 9223372036854775807 0

Sorry Bump

about “could not bind 0.0.0.0:80”:

use top or htop to see if Apache is actually dead of not. sometimes it it will restart, get updated, etc, and it’s PID file will not get updated. this makes virtualmin think that Apache is dead, when it is indeed alive. I didn’t see anything in particular within regard to your log files, that make me think apache actually errored out.

the only lines I seen related to Apache having quit, was it catching SIGTERM, which might be related to you restarting apache, or maybe the OOM task manager has killed it.

How much Memory does your system have? do you have any Cron scripts that consume a large amount of memory? do you use clamscan or clamd?

about your zombie processes:

use top or htop to find out what is in the zombie state. if it is Apache Processes, their might be something that is not configured properly. I could be wrong, but this might cause problems with Apache, and how it calculates it’s worker pool size and resource limts.

if the zombie processes are php-cgi processes, than mod_fcgid is not properly configured to clean up dead workers. it might not be a problem in theory (remember: you are using a container and things are simulated, which can often cause things to have unexpected results), but I would argue that If fcgid is not cleaning up zombie processes properly, it might not be managing it’s resources properly either.

properly configured, mod_fcgid should spawn php-cgi processes on demand as needed, but it should be set to max out somewhere, and be set to properly clean up these processes depending on error, timeout, and period of time in the busy state. in virtualmin, you set only the worker pool size.

you must take a look at fcgid.conf and configure this to suit your servers demands, by setting things like timeouts and maximum processes limits. per class = per website (or per user).

left improperly configured, mod_fcgid could quickly consume all your resources, and OpenVZ and the OOM Task Manager will kill things at random (even Apache itself).

however, when it is configured right, you can have each site always leave one worker pool running, but max out at some sort of reasonable limit. when configured right, mod_fcgid will kill it’s zombies in a timley manner.

with all this said, make sure that Apache is actually dead. it could just be reported dead in error. like I said, next time this happens, check using top or htop. if it IS being killed, you might want to look into “monit”. this is a very easy to configure process monitor, which will bring up apache as soon as it goes down, and can even kill or restart apache if it starts to consume too much resources, and spins out of control.