Cannot stop/restart Apache

12 posts / 0 new
Last post
#1 Sun, 10/13/2013 - 16:28
JdS

Cannot stop/restart Apache

Since the last update to Webmin

...
Oct 11 18:20:39 Updated: webmin-1.660-1.noarch
Oct 11 18:21:03 Updated: usermin-1.570-1.noarch

I have not been able to /stop or restart Apache on one of my VPS.

When I reboot the server, Apache is running and all my sites are online. When I try to restart the daemon through a terminal though, this is what I get (consistently):

$ sudo service httpd graceful
httpd not running, trying to start
(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

After this, Webmin's System Information page indicates that the Apache Webserver service has stopped but it is not really because my sites are still responding.

Let me know if you require any more details.

Sun, 10/13/2013 - 22:24
andreychek

Howdy,

Well, that's not likely related to the Webmin or Usermin version, as the issue you're seeing is within Apache... however, were any Apache modules enabled recently? That's one possible cause.

What distro/version is it that you're using?

And what is the output of this command:

rpm -qa | grep httpd

Mon, 10/14/2013 - 06:49 (Reply to #2)
JdS

I am glad that this issue is unrelated to the Webmin upgrade. I typically restart Apache at least once a day but noticed this error for the first time only after this last (Webmin) upgrade, so I surmised that it was related.

"Apache modules enabled recently?"

No , no Apache modules were enabled or disabled recently - at least I cannot recall doing anything out of the ordinary these past few days (I have more than one server to manage).

The answer to your last 2 questions:

$ cat /etc/centos-release
CentOS release 6.4 (Final)
 
$ rpm -qa | grep httpd
httpd-tools-2.2.15-29.el6.vm.1.x86_64
httpd-2.2.15-29.el6.vm.1.x86_64
Mon, 10/14/2013 - 09:12
andreychek

Howdy,

Hmm, yeah that all appears normal.

We've occasionally heard about issues like that, primarily on CentOS systems... and it's occasionally resolved by tweaking this or that module :-)

What is the output of this command:

ls /etc/httpd/conf.d/

Mon, 10/14/2013 - 16:33 (Reply to #4)
JdS

The output of the command is:

$ ls -l /etc/httpd/conf.d/
total 60
-rw-r--r-- 1 root root    1009 Feb 28  2013 awstats.conf
lrwxrwxrwx 1 root root      47 Aug 28 01:39 bad_pattern_in_ua.conf -> /usr/share/gidshare/conf/bad_pattern_in_ua.conf
-rw-r--r-- 1 root root     455 Apr 23  2012 fcgid.conf
-rw-r--r-- 1 root root     139 Nov 16  2012 geoip.conf
-rw-r--r-- 1 root mailman  641 Nov 20  2012 mailman.conf
-rw-r--r-- 1 root root    1796 Apr 22  2005 perl.conf
-rw-r--r-- 1 root root     674 Jul 12 15:40 php.conf
-rw-r--r-- 1 root root    1671 Aug 28 10:03 python.conf
-rw-r--r-- 1 root root     392 Aug 25 11:29 README
-rw-r--r-- 1 root root    9473 Aug  2 06:59 ssl.conf
-rw-r--r-- 1 root root    1042 Apr 11  2013 subversion.conf
-rw-r--r-- 1 root root     352 Sep  9  2004 webalizer.conf
-rw-r--r-- 1 root root     299 Aug  2 06:59 welcome.conf
-rw-r--r-- 1 root root     304 May 17 19:08 welcome.conf.BAK

There doesn't seem to be anything out of the ordinary there.

In case you're wondering about the contents of bad_pattern_in_ua.conf file, it is just a file with a few lines of BrowserMatch and BrowserMatchNoCase patterns and setting some environment variables when a match is found.

Wed, 10/16/2013 - 23:53
JdS

Since I have not found the solution yet, I'd update this thread with new information as I gather them.

Earlier today, when I looked at the httpd.pid file, this is what I found:

$ sudo cat /var/run/httpd/httpd.pid
836

However, when I list the processes, I don't find this PID anywhere!

$ sudo ps -A | grep 836
$

This, I am sure, is the main reason I cannot STOP (or restart) the apache/httpd daemon, right?

What could cause the main/parent httpd process to stop but not update the httpd.pid file?

Wed, 10/16/2013 - 23:59
andreychek

Hmm, what kind of VPS do you have... Xen, KVM, OpenVZ?

Thu, 10/17/2013 - 00:06 (Reply to #7)
JdS

That's actually a good question, andreychek, because I share the httpd configuration files for this VPS with another one.

This VPS has this problem and the other one just runs normally and smoothly. This problem VPS runs on OpenVZ, the trouble-free one runs on Xen.

Thu, 10/17/2013 - 09:24
andreychek

Howdy,

Okay, can you post the contents of your /proc/user_beancounters file?

-Eric

Thu, 10/17/2013 - 10:05
JdS

As per your request, Eric.

Version: 2.5
       uid  resource                     held              maxheld              barrier                limit              failcnt
     2664:  kmemsize                 44261438             82563072            536870912            536870912                    0
            lockedpages                     0                 1055               131072               131072                    0
            privvmpages                249266               560723  9223372036854775807  9223372036854775807                    0
            shmpages                     1206               263350  9223372036854775807  9223372036854775807                    0
            dummy                           0                    0                    0                    0                    0
            numproc                        86                  165                  800                  800                    0
            physpages                  140526               262143                    0               262144                    0
            vmguarpages                     0                    0  9223372036854775807  9223372036854775807                    0
            oomguarpages                73400               156288  9223372036854775807  9223372036854775807                    0
            numtcpsock                     28                  143                 1300                 1300                    0
            numflock                       10                   35                 1024                 1024                    0
            numpty                          1                    2  9223372036854775807  9223372036854775807                    0
            numsiginfo                      0                   45                 1024                 1024                    0
            tcpsndbuf                  488320              3093552  9223372036854775807  9223372036854775807                    0
            tcprcvbuf                  458752              8722168  9223372036854775807  9223372036854775807                    0
            othersockbuf               191368               711984  9223372036854775807  9223372036854775807                    0
            dgramrcvbuf                     0                24408  9223372036854775807  9223372036854775807                    0
            numothersock                  156                  290                 1300                 1300                    0
            dcachesize               11862791             46681201            268435456            268435456                    0
            numfile                      1883                 3675  9223372036854775807  9223372036854775807                    0
            dummy                           0                    0                    0                    0                    0
            dummy                           0                    0                    0                    0                    0
            dummy                           0                    0                    0                    0                    0
            numiptent                      43                   43                 3000                 3000                    0

I am seeing this file for the very first time. I'm going to have to read up on it next. :-)

Thu, 10/17/2013 - 12:25
andreychek

Howdy,

I was curious if you were running into any resource issues... maybe an Apache process was being killed off due to RAM constraints, for example.

We see quite a few issues relating to OpenVZ and resource problems... however, it doesn't appear that you're seeing that. If you were hitting resource issues, they would show up in the "failcnt" field.

Out of curiosity, what does "free -m" show?

-Eric

Thu, 10/17/2013 - 21:06 (Reply to #11)
JdS

As per your request, Eric.

$ sudo free -m
             total       used       free     shared    buffers     cached
Mem:          1024        736        287          0          0        374
-/+ buffers/cache:        362        661
Swap:         1024         34        989
Topic locked