Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache hangs
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
jcampbell
n00b
n00b


Joined: 24 Sep 2005
Posts: 40

PostPosted: Sun Sep 25, 2005 4:13 am    Post subject: Apache hangs Reply with quote

This is strange... I start apache and it works. I restart it and get this:

Code:
tiger ~ # /etc/init.d/apache2 start
 * Starting apache2 ...                                                                         [ ok ]
tiger ~ # /etc/init.d/apache2 stop
 * Stopping apache2 ...
httpd (no pid file) not running                                                                 [ ok ]
tiger ~ # /etc/init.d/apache2 start
 * Starting apache2 ...
(98)Address already in use: make_sock: could not bind to address [::]:80
no listening sockets available, shutting down
Unable to open logs
tiger ~ # /etc/init.d/apache2 zap
 * Manually resetting apache2 to stopped state.
tiger ~ # killall -s SIGKILL apache2
tiger ~ #


The apache server stays running even after the init script dies. There is no apache.pid in /var/run but the process continues to run. Best part is that no matter how many times I start apache after the initial failure, the server hangs when I try to browse any sites that it hosts. The only way I've been able to fix it is to reboot.

I don't recall ever having this problem before...


Last edited by jcampbell on Sun Sep 25, 2005 5:31 am; edited 1 time in total
Back to top
View user's profile Send private message
jcampbell
n00b
n00b


Joined: 24 Sep 2005
Posts: 40

PostPosted: Sun Sep 25, 2005 4:50 am    Post subject: Reply with quote

okay... more info... viewing apache's error_log:

Code:
[Sun Sep 25 01:16:39 2005] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec2)
[Sun Sep 25 01:16:39 2005] [notice] Digest: generating secret for digest authentication ...


I commented out this line in httpd.conf:

Code:
LoadModule auth_digest_module            modules/mod_auth_digest.so


and it cured the problem. It's okay for a work-around, but why is this causing apache to hang?


Apparently, this has been an issue before? It's a different apache version... I have 2.0.54-r31
https://forums.gentoo.org/viewtopic-t-151105-highlight-authdigestmodule.html
Back to top
View user's profile Send private message
gbpack
n00b
n00b


Joined: 11 Oct 2004
Posts: 8

PostPosted: Sun Sep 25, 2005 7:03 am    Post subject: Reply with quote

I'm still having this exact problem. I tried the workaround but that didn't work either. I posted this in IRC a little while ago but no one replied. If anyone has any ideas .... it would be greatly appreciated.
Back to top
View user's profile Send private message
Janne Pikkarainen
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1143
Location: Helsinki, Finland

PostPosted: Sun Sep 25, 2005 8:19 am    Post subject: Reply with quote

I had the same problem with Apache 1.3.x some years back, but I can't remember if I ever fixed it (in any other way than not using the mod_auth_digest).

Anyway, maybe this problem could be a classic "kernel runs out of entropy" problem? If your server runs mostly idle and mod_auth_digest gets its digest data from /dev/random, it could be that kernel is unable to generate random data fast enough. Check that with command cat /proc/sys/kernel/random/entropy_avail -- if it's 0, then your server has temporarily run out of entropy.

In that case you may emerge rng-tools and run rngd, which generates some less perfect entropy.
_________________
Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.".
Back to top
View user's profile Send private message
gbpack
n00b
n00b


Joined: 11 Oct 2004
Posts: 8

PostPosted: Sun Sep 25, 2005 3:25 pm    Post subject: Reply with quote

cat /proc/sys/kernel/random/entropy_avail says 4096.
Back to top
View user's profile Send private message
gbpack
n00b
n00b


Joined: 11 Oct 2004
Posts: 8

PostPosted: Sun Sep 25, 2005 5:04 pm    Post subject: Reply with quote

installed rng-tools and started it up. Tried starting apache2 again and it still doesn't put a pid file in /var/run. Apache says it started ok, but my home page won't load. Error log says:

[Sun Sep 25 11:31:05 2005] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec2)
[Sun Sep 25 11:31:07 2005] [notice] Digest: generating secret for digest authentication ...
[Sun Sep 25 11:31:07 2005] [notice] Digest: done

I have no idea what to do?
Back to top
View user's profile Send private message
Troy
n00b
n00b


Joined: 27 May 2003
Posts: 23
Location: Oklahoma

PostPosted: Mon Sep 26, 2005 4:46 am    Post subject: Reply with quote

It's not just you. Since the update, I can't restart apache :( I have no entropy and no physical access to the system to create entropy. I'd used MY_BUILTINS="--with-devrandom=/dev/urandom" emerge apache in the past to fix this. It's not fixing it this time. I added urandom to my USE flags as suggested by the apr-0.9.6 ebuild, rebuilt APR and apache2 with no success. Not good...
_________________
And the glory of the LORD shall be revealed, and all flesh shall see it together: for the mouth of the LORD hath spoken it.
Isaiah 40.5
Back to top
View user's profile Send private message
taiger
Tux's lil' helper
Tux's lil' helper


Joined: 25 Nov 2003
Posts: 112

PostPosted: Mon Sep 26, 2005 6:35 pm    Post subject: Reply with quote

I have the same problem

I have temporaly cammented:

modules/mod_auth_digest.so


:?:
Back to top
View user's profile Send private message
chrismear
n00b
n00b


Joined: 11 Jul 2005
Posts: 12
Location: London, England

PostPosted: Sat Oct 01, 2005 9:17 am    Post subject: Reply with quote

This might be some help. On one of my servers, it generates the secret instantly, so I never noticed this problem. But on another server, it takes about two minutes to generate the secret. Once it's done that, though, apache runs perfectly:

[Sat Oct 01 10:00:36 2005] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec2)
[Sat Oct 01 10:00:36 2005] [notice] Digest: generating secret for digest authentication ...
[Sat Oct 01 10:02:33 2005] [notice] Digest: done
[Sat Oct 01 10:02:34 2005] [notice] Apache configured -- resuming normal operations

I don't know how to make it work faster, but in the meantime I'm happy just to wait for a couple of minutes while it sorts itself out.
Back to top
View user's profile Send private message
Taily
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jun 2004
Posts: 115

PostPosted: Fri Oct 07, 2005 9:20 pm    Post subject: Reply with quote

Well for me the apache server would just "hang" at
Code:
[Sat Oct 08 00:12:27 2005] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec2)
[Sat Oct 08 00:12:28 2005] [notice] Digest: generating secret for digest authentication ...

However when you did /etc/init.d/apache2 stop.. the server would actually not die, it finnishes loading itself and is alive :/

This was all due to an error in apache configuration. I suggest running apache2 -k stop after you've started it and see if it reports some error.
Back to top
View user's profile Send private message
j-m
Retired Dev
Retired Dev


Joined: 31 Oct 2004
Posts: 975

PostPosted: Fri Oct 07, 2005 10:10 pm    Post subject: Reply with quote

Quote:
emerge sys-apps/clrngd


:idea:
Back to top
View user's profile Send private message
bytelab
n00b
n00b


Joined: 29 Sep 2003
Posts: 14
Location: Sweden

PostPosted: Tue Nov 08, 2005 12:07 pm    Post subject: Reply with quote

I have the same problem but after a little testing I found it to be an entropy issue.
Thanks guys for a very informative thread ;)
_________________
AMD Athlon 64 4000+
2048 meg MEMORY
Asus Radeon x800xt PE
2x80 GB (raid 0)
Gentoo Linux 2005.1 + Win XP Home
Back to top
View user's profile Send private message
TJNII
l33t
l33t


Joined: 09 Nov 2003
Posts: 637
Location: for(;;);

PostPosted: Wed Nov 09, 2005 2:22 am    Post subject: Reply with quote

Wow. I never knew a computer could run out of entropy. :P

Code:

PrISUm2 / # ps -ec | grep apache
25393 TS   14 ?        00:00:00 apache2
PrISUm2 / # emerge -s I_Like_Pudding
Searching...   
[ Results for search key : I_Like_Pudding ]
[ Applications found : 0 ]
 

PrISUm2 / # ps -ec | grep apache
25393 TS   23 ?        00:00:00 apache2
25482 TS   21 ?        00:00:00 apache2
25484 TS   20 ?        00:00:00 apache2
25485 TS   19 ?        00:00:00 apache2
25486 TS   18 ?        00:00:00 apache2
25487 TS   17 ?        00:00:00 apache2
25488 TS   15 ?        00:00:00 apache2
PrISUm2 / #

_________________
Maintaining documentation on upgrades is apparently not within the power of Gentoo
Beware when you emerge -u world!
Back to top
View user's profile Send private message
ohcnetwork
n00b
n00b


Joined: 27 Dec 2005
Posts: 2

PostPosted: Tue Dec 27, 2005 7:50 am    Post subject: Reply with quote

Hi, I know that this is not RHE or Apache forum, but after I spent many hours searching for a solution to my problem, I only found a few places that discuss the problem, and this seems to be one place that I can ask about the problem and its possible solution, so I'm posting here. Hope it's ok ...

I am having a similar problem, and Apache2 installed on my server hangs. Apache2 is installed on RHE and it happens periodically. I tried to find causes, but the reason why I'm posting here is that I see the following error message in my error log file (and this is mentioned in this thread):
Code:

[Fri Dec 23 01:00:30 2005] [notice] Digest: generating secret for digest authentication ...
[Fri Dec 23 01:00:30 2005] [notice] Digest: done

I see the notice recorded number of times although this is not exactly when Apache2 hangs. My questions are as follows:

Q1. Does the notice indicate that Apache2 can hang periodically?

Q2. If so, does commenting out modules/mod_auth_digest.so resolve the problem (temporarily)?

Q2.2. What does modules/mod_auth_digest.so really do and do I need it?

Q3. A couple of people mention about entropy in this thread, but what is it (my apology if this is such a trivial question)?

Q4. If entropy is really the problem on my system, how do I know if it's really the case?

Q5. If it is the case, how can I fix it?
_________________
Current Health News Mental Health Problems
Recumbent Exercise Bikes
Back to top
View user's profile Send private message
ocbMaurice
Tux's lil' helper
Tux's lil' helper


Joined: 14 Feb 2003
Posts: 85
Location: Switzerland

PostPosted: Tue Dec 27, 2005 3:19 pm    Post subject: Reply with quote

Your Problem is not likely related to the entropy pool. The problem with the entropy pool is the automatic generation of the secret for mod_auth_digest. To create a new secret (cypher key) it needs some (real) random data which is taken from the entropy pool. If the entropy pool is empty, the generation will take a long time. But in your case the generation was done in a very short time.
Back to top
View user's profile Send private message
ohcnetwork
n00b
n00b


Joined: 27 Dec 2005
Posts: 2

PostPosted: Tue Dec 27, 2005 6:46 pm    Post subject: Reply with quote

ocbMaurice wrote:
Your Problem is not likely related to the entropy pool. The problem with the entropy pool is the automatic generation of the secret for mod_auth_digest. To create a new secret (cypher key) it needs some (real) random data which is taken from the entropy pool. If the entropy pool is empty, the generation will take a long time. But in your case the generation was done in a very short time.

... then what is causing Apache (on my server) to hang?
_________________
Current Health News Mental Health Problems
Recumbent Exercise Bikes
Back to top
View user's profile Send private message
mizery de aria
Guru
Guru


Joined: 07 Dec 2003
Posts: 309

PostPosted: Wed Feb 15, 2006 12:34 am    Post subject: Reply with quote

*bump*
having this problem too...
_________________
Do not repIy to or othErwise communicate with me if you use religious, spiritual or similar terminologies or references in your typings.
Back to top
View user's profile Send private message
pirus3210
n00b
n00b


Joined: 02 Mar 2006
Posts: 19

PostPosted: Fri Mar 03, 2006 1:43 pm    Post subject: Reply with quote

i had the same problem.. Apache2 wouldnt start.

Try
#ps aux

if you can see apache there do this
#pkill -KILL apache

then try restarting
Back to top
View user's profile Send private message
LL0rd
l33t
l33t


Joined: 24 May 2004
Posts: 652
Location: Schlundcity

PostPosted: Sat Mar 04, 2006 11:38 am    Post subject: Reply with quote

Hi,

I have exactly the same problem.
Code:
[Fri Dec 23 01:00:30 2005] [notice] Digest: generating secret for digest authentication ...
[Fri Dec 23 01:00:30 2005] [notice] Digest: done


That problem appears, when I try to restart apache with the restart command. You can do everything you want, you can't get apache up. But if I restart apache with stop and then start, apache runs without problems. To solve the problem with hanging apache, I restarted the whole OS, after that, I could start apache with the start command.

Thats a realy strange behavior, it's like...... windows ;)
_________________
Alte Mathematiker sterben nicht - sie verlieren nur einige ihrer Funktionen.
Back to top
View user's profile Send private message
Bash[DevNull]
Guru
Guru


Joined: 10 Oct 2003
Posts: 333

PostPosted: Wed Mar 08, 2006 11:13 pm    Post subject: Reply with quote

I've removed "LoadModule auth_digest_module modules/mod_auth_digest.so" line from config,
BUT it's not HELP me because on restart/start apache2 freezes (50-200sec) on reading from /dev/random!!!
Why? I have no other digest modules....
_________________
Biomechanical Artificial Sabotage Humanoid


Last edited by Bash[DevNull] on Thu Mar 09, 2006 4:45 am; edited 1 time in total
Back to top
View user's profile Send private message
LL0rd
l33t
l33t


Joined: 24 May 2004
Posts: 652
Location: Schlundcity

PostPosted: Wed Mar 08, 2006 11:21 pm    Post subject: Reply with quote

okay, I don't realy know, what the error realy is, but I had restarted my apache webserver. After the restart I had just one apache process. Then me and my girlfriend hat a little bit fun :D 8) :D After about half an hour I was back and apache was running
_________________
Alte Mathematiker sterben nicht - sie verlieren nur einige ihrer Funktionen.
Back to top
View user's profile Send private message
maverick6664
Guru
Guru


Joined: 13 May 2005
Posts: 413
Location: Tokyo / Japan

PostPosted: Fri Mar 24, 2006 1:57 pm    Post subject: Reply with quote

Thanks all. Having the same problem I found this thread today, and finally found tapping the keyboard (not on a remote console, but on the "real" console w/o X Window) seemed to help. :) Maybe moving the mouse or other factors will also help.

The value of /proc/sys/kernel/random/entropy_avail on my http server is often low (around or below 100) and this value actually affects the freezing time period. My kernel is generic 2.6.16.

EDIT: Running X Server doesn't seem to matter at all. Keyboard and mouse always affect much. Moving mouse is the most efficient in my case.
_________________
Tetsuji Rai
a.k.a. Lukiest in the world
Back to top
View user's profile Send private message
eltech
Guru
Guru


Joined: 05 Nov 2002
Posts: 582
Location: New York

PostPosted: Thu Apr 13, 2006 7:24 pm    Post subject: Reply with quote

j-m wrote:
Quote:
emerge sys-apps/clrngd


:idea:
This did work for me today as i ran into this problem .. and i just ran clrngd and the problem has been fixed, but will this run again on its own if and when centropy memory runs out ?

how can i prevent such happening>?
Back to top
View user's profile Send private message
okuhl
n00b
n00b


Joined: 09 Apr 2003
Posts: 22

PostPosted: Mon Apr 24, 2006 2:11 pm    Post subject: Solution for me Reply with quote

Hi,

this worked for me, too:



Code:
# cat /proc/sys/kernel/random/entropy_avail
0
# emerge -a clrngd
# /etc/init.d/clrngd start
# cat /proc/sys/kernel/random/entropy_avail
256
# /etc/init.d/apache2 start


Regards,
Oliver.
Back to top
View user's profile Send private message
soth
Apprentice
Apprentice


Joined: 12 Sep 2003
Posts: 207

PostPosted: Wed Jul 26, 2006 7:51 am    Post subject: Reply with quote

yay! No more problems for me!
_________________
- Never argue with an idiot. They just drag you down to your level and beat you with experience.

Join the adopt an unanswered post initiative today
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum