Go Back   cPanel Forums > General Discussion > cPanel Newbies

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-17-2009, 06:16 AM
Registered User
 
Join Date: May 2009
Posts: 4
kamlesh_chaube is on a distinguished road
how to display httpd processes of current login user

Sir,

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

OUTPUT :-

root 23972 1 0 Jul06 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
root 24017 23972 0 Jul06 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 24024 23972 0 Jul06 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 24025 23972 0 Jul06 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 24027 23972 0 Jul06 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 24028 23972 0 Jul06 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 24029 23972 0 Jul06 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 25862 23972 0 Jul06 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 14286 23972 0 Jul07 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 14297 23972 0 Jul07 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 14298 23972 0 Jul07 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
jholco 20017 20008 0 12:30 ? 00:00:00 sh -c ps -ef | grep httpd
jholco 20019 20017 0 12:30 ? 00:00:00 grep httpd

Current login user is jholco.
I want to display only jholco's process. Please help me.
How can i display it.

Thanks,
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-17-2009, 11:13 AM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 7,995
cPanelDavidG is on a distinguished road
Quote:
Originally Posted by kamlesh_chaube View Post
Sir,

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

OUTPUT :-

root 23972 1 0 Jul06 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
root 24017 23972 0 Jul06 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 24024 23972 0 Jul06 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 24025 23972 0 Jul06 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 24027 23972 0 Jul06 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 24028 23972 0 Jul06 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 24029 23972 0 Jul06 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 25862 23972 0 Jul06 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 14286 23972 0 Jul07 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 14297 23972 0 Jul07 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 14298 23972 0 Jul07 ? 00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
jholco 20017 20008 0 12:30 ? 00:00:00 sh -c ps -ef | grep httpd
jholco 20019 20017 0 12:30 ? 00:00:00 grep httpd

Current login user is jholco.
I want to display only jholco's process. Please help me.
How can i display it.

Thanks,
In a cPanel/WHM environment, Apache always runs as user nobody. However, PHP processes will run as the user if you are running SuPHP.
__________________
Want our technical analysts to login to your server to assist you? You can contact our technical analysts at: http://tickets.cPanel.net/submit
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-17-2009, 06:05 PM
Spiral's Avatar
Registered User
 
Join Date: Jun 2005
Location: Area 51
Posts: 1,501
Spiral is on a distinguished road
Exclamation

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)/...".
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
httpd

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to Display the current Server Load chican0 cPanel and WHM Discussions 3 03-02-2005 07:13 PM
Show Current Running Processes racomnet cPanel and WHM Discussions 1 12-29-2004 09:22 AM
100+ current mysql processes chadi cPanel and WHM Discussions 1 08-05-2004 12:00 AM
httpd processes and user nobody - who is using it? pingo cPanel and WHM Discussions 3 03-10-2003 11:39 AM


All times are GMT -5. The time now is 10:49 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc