How can I check where Apache2 is located?

My Apache2 hangs. I cannot get any answer from him.

I tried to run wget localhost

it just hangs like this:

--2012-03-12 06:36:40--  http://localhost/
Resolving localhost...
Connecting to localhost||:80... connected.
HTTP request sent, awaiting response...


How do I get more information about debugging?


source to share

2 answers

Use netstat -nt

to find out what connections are on port 80 of

You can use fuser -n tcp 80,,<port-number>

to find the PID of the Apache process that has a TCP connection on port 80 of from the given one.

Then follow strace -p <pid>

this process to see what it does at the system call level.

You can follow the pid lookup steps if you restart Apache in single process mode (assuming the hanger is still playable!) If that were the case, I would just run this Apache under strace

and capture the traceback.

Based on this, I would decide what to do next. It hangs in the salon, doesn't hang in syscall, ... which is syscall. The latest resorts will get a debug build and gdb

-in it.

Apache Debugging Guide:



Try it tail -f /var/log/apache/error_log


Your path to error_log

may differ. Try it to search find / -name error_log

. If you are not logged in as root

, then you may see a bunch of "allowed permission". In this case, you can hide error messages with, find / -name error_log 2>/dev/null

or try to guess the location with find /var/log/ -name error_log




All Articles