The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Who does apache run as?

Discussion in 'EasyApache' started by DavidR, Feb 10, 2005.

  1. DavidR

    DavidR Well-Known Member

    Joined:
    Feb 25, 2003
    Messages:
    177
    Likes Received:
    0
    Trophy Points:
    16
    I have a script that says to chown a certain directory as "apache:apache" if that is how apache runs on my machine. I'm still newbie enough to Linux that I don't know how to find this out, so how do you know what user & group apache runs under? Is it normally apache:apache? Thank you.

    David
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    No. If you have suexec enabled (which most servers do/should have) then user directories and files should be chowned as account:account whether they're perl or php scripts. Apache, without suexec, runs as nobody:nobody. Additionally, php scripts will run as nobody:nobody if you do not have phpsusexec enabled, but you should still chown the files with the owner of account that you're installing them into.
     
  3. jester.ro

    jester.ro Well-Known Member
    PartnerNOC

    Joined:
    Feb 6, 2004
    Messages:
    304
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bucharest, Romania
    cPanel Access Level:
    DataCenter Provider
    actually, to be sure of the username apache runs on, look into your httpd.conf

    find where it says

    User XXXX
    Group XXXX

    default is nobody:nobody, but it's not necessary to be like that, i have it running on apache:apache on some servers, and on some others on nobodytmp:nobodytmp

    (PS. none of the servers run cpanel :) )
     
  4. DavidR

    DavidR Well-Known Member

    Joined:
    Feb 25, 2003
    Messages:
    177
    Likes Received:
    0
    Trophy Points:
    16
    Well I understand from the installation instructions on this script that the idea is to allow writing to certain directories without the security risk of 777. So, if I understand correctly, I should chown those directories as account:account, where account is the username of the domain account the script is running under? Thanks.

    David
     
  5. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Yes.

    *filler for the min post requirement*
     
  6. DavidR

    DavidR Well-Known Member

    Joined:
    Feb 25, 2003
    Messages:
    177
    Likes Received:
    0
    Trophy Points:
    16
    Will do, thanks!

    David
     
Loading...

Share This Page