How to Tell Which Apache Process Is Hanging & on What Script?
- 1). Edit the number of processes and threads in the Apache servers MPM configuration stanza, or use Apache's "-X" option to start Apache in single process mode. Doing so can speed up troubleshooting.
- 2). Check for configuration file problems by using the httpd "-t" option to check the Apache configuration file for syntax errors. If there is an error in the file, the configuration check should identify the line with the error.
- 3). Look for script execution problems using the mod_cgi ScriptLog command. When ScriptLog is active, mod_cgi logs the server response code, the request that was received, and the response that was sent to the client from all running CGI script that failed to execute correctly.
- 4). View the log on your server to find out what the last accessed script was as that's the script that probably made your server appear to hang.
- 5). Perform a stack backtrace to determine why the the server hung. You can do this by using pstack, a program that prints a stack backtrace or by using the your server’s gdb and gcore utilities.
Source...