How do I know what an apache process is doing?

21,537

Solution 1

Make sure you have mod_status.so loaded within your apache modules then look for/add the above to your httpd.conf:

# Uncomment the following lines to enable mod_status support:
#
ExtendedStatus On

<Location /server-status>
SetHandler server-status

Order Deny,Allow
Deny from all
Allow from YOUR_IP_HERE
</Location>

This will allow you to see all the pages being used load domain within your http server.

To access it use http://your_ip/server-status and only the ip defined at Allow from YOUR_IP_HERE will be able to view it.

Solution 2

An lsof -p will show you what file handle it is waiting for. Also strace -p and ltrace -p might be handy to try to debug it.

Share:
21,537

Related videos on Youtube

Joernsn
Author by

Joernsn

Updated on September 17, 2022

Comments

  • Joernsn
    Joernsn almost 2 years

    Sometimes apache goes crazy and eats all my memory and swap, but I don't know how to find out which web app is the causing it.

    ps gives me this output for the process; "Uninterruptible sleep (usually IO)"

    www-data  1526  0.1 78.9 14928852 3191628 ?    D    Oct17   6:45 /usr/sbin/apache2 -k start
    

    I suspect Ruby+Redmine, but I want to be sure

  • Joernsn
    Joernsn over 13 years
    Both very good answers :)
  • Andron
    Andron over 7 years
    Also I suggest to use Allow from localhost, so later it is possible to check that info via lynx http://localhost/server-status in console.
  • Aleksandar Pavić
    Aleksandar Pavić over 4 years
    In Apache 2.4 it's Require all granted instead of Order ...