My Apache2 hangs. I can’t get any response from it.
I tried to run wget localhost
it just hangs like this:
--2012-03-12 06:36:40-- http://localhost/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response...
How can I get more debug information?
Use
netstat -ntto see what connections there are to port 80 from 127.0.0.1.You can use
fuser -n tcp 80,127.0.0.1,<port-number>to look for the PID of the Apache process which has port 80 TCP connection from 127.0.0.1 from the given .Then do an
strace -p <pid>on that process to see what it’s doing at the system call level.You can take out the pid-finding steps if you restart Apache in single-process mode (provided that the hang still reproduces!) If that were the case I would just run that Apache under
straceand capture the trace.Based on that I would decide what to do next. Is it hanging in a syscall, not hanging in a syscall, … which syscall. Last resorts would be getting a debugging build and
gdb-ing it.Apache debugging guide: http://httpd.apache.org/dev/debugging.html