Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    4

    Default 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,

  2. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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.

  3. #3
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Exclamation

    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)/...".

Similar Threads & Tags
Similar threads

  1. How can i display all httpd processes
    By kamlesh_chaube in forum New User Questions
    Replies: 1
    Last Post: 09-24-2009, 11:50 PM
  2. Script to Display the current Server Load
    By chican0 in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 03-02-2005, 07:13 PM
  3. Show Current Running Processes
    By racomnet in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 12-29-2004, 09:22 AM
  4. 100+ current mysql processes
    By chadi in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-05-2004, 12:00 AM
  5. httpd processes and user nobody - who is using it?
    By pingo in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 03-10-2003, 11:39 AM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube