Quote:
I am working in php. I have create cPanel plugin.
I want display httpd processes of current login user.
Using unix command ps -ef | grep httpd it give me following output
|
Wrong command entirely!
If you "ps -ef" the Apache server, the only thing you are going to get
back is user "nobody" daemons that tell you pretty much nothing!
You can call the queue information from Apache to see what
is currently being viewed but that won't tell you which user ;
only which web site and pages currently being viewed.
If you want to see what scripts are being run by a particular
user which is what it sounds like you are trying to do then you
don't want to run any "ps" commands but rather you would want
to "grep" the following log files for the username you want:
Log that shows normal CGI scripts (perl) that have been run:
Code:
/usr/local/apache/logs/suexec_log
Log that shows PHP scripts run if running as SuPHP:
Code:
/usr/local/apache/logs/suphp_log
In addition to showing the full path of the script executed in the suphp_log,
it also shows you the UID number for the user the script ran under and
that can be cross referenced with the UID numbers in /etc/passwd if
you want to make sure the script was indeed run from the user shown
in the path such as "/home/
(username)/...".