linux – 查找每个HTTPD进程上运行的PHP脚本

前端之家收集整理的这篇文章主要介绍了linux – 查找每个HTTPD进程上运行的PHP脚本前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我想知道一种检查HTTPD进程的方法,以找出在其上运行的 PHP脚本.

我已经做了一个“netstat”,发现有些进程持有DB和网络套接字太长时间了,现在我想知道是什么脚本导致了它.

顺便说一下,我正在使用Linux.

解决方法

您需要启用Apache模块 mod_status(CentOs主Apache配置文件位于/etc/httpd/conf/httpd.conf)
  1. LoadModule status_module modules/mod_status.so

使用选项ExtendedStatus on(这将在与上面相同的配置文件中设置)

  1. # ExtendedStatus controls whether Apache will generate "full" status
  2. # information (ExtendedStatus On) or just basic information (ExtendedStatus
  3. # Off) when the "server-status" handler is called. The default is Off.
  4. #
  5. ExtendedStatus On

以及为此设置的一些访问权限(将XXX.XXX.XXX.XXX替换为您的IP – 这可以在与上面相同的配置文件中找到)

  1. # Allow server status reports generated by mod_status,# with the URL of http://servername/server-status
  2. # Change the ".example.com" to match your domain to enable.
  3. #
  4. <Location /server-status>
  5. SetHandler server-status
  6. Order deny,allow
  7. Deny from all
  8. Allow from localhost 127.0.0.1 XXX.XXX.XXX.XXX
  9. </Location>

最后,您将通过访问http://your-server-name/server-status来查看每个HTTPD进程正在执行的操作

这将显示当前正在以here呈现的方式处理的pids和URL.

猜你在找的Linux相关文章