Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder GO ILLINI's Avatar
    Join Date
    Jun 2005
    Location
    USA
    Posts
    634
    Thanks
    0
    Thanked 7 Times in 7 Posts

    group apache uses

    Is there some php way to find the croup that apache is running as? I know that it is usually 'apache' but the script I am writing needs to work on multiple stations that I dont know the specs of.

    Thanks,
    -Adam
    Why not thank me?

    http://adamsworld.name

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    nobody/apache/www-data/www/httpd ... so many common ones + all the uncommon ones people use for different reasons.

    If this was dynamic you could create a file which should have the user and group ownership of the webserver and then grab the uid and gid from stat() ?
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    Regular Coder GO ILLINI's Avatar
    Join Date
    Jun 2005
    Location
    USA
    Posts
    634
    Thanks
    0
    Thanked 7 Times in 7 Posts
    well isnt that just for files? I need it to find the httpd process group so that I can chgrp to be able to edit files, but this program will be redistributed so I need it to find out the group.
    example: On my system, I have the install script just change the group and use a minimal chmod, but the original user will still be able to edit the files. On my server the group is apache but I need some way to find it on other systems.

    -Adam
    Why not thank me?

    http://adamsworld.name

  • #4
    Regular Coder ralph l mayo's Avatar
    Join Date
    Nov 2005
    Posts
    951
    Thanks
    1
    Thanked 31 Times in 29 Posts
    posix_getegid() gets the effective group id and you can get more info about it including the short name with posix_grgrgid($egid)

  • #5
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    Quote Originally Posted by GO ILLINI View Post
    well isnt that just for files? I need it to find the httpd process group so that I can chgrp to be able to edit files -Adam
    yes it is, thats the point, in your setup routine have apache create a file, then check its uid and gid, you would have to do this at runtime.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #6
    Regular Coder GO ILLINI's Avatar
    Join Date
    Jun 2005
    Location
    USA
    Posts
    634
    Thanks
    0
    Thanked 7 Times in 7 Posts
    Haha I didnt think of that... (Post time: "07-16-2007, 12:14 AM"). Ok It works great thanks.
    Why not thank me?

    http://adamsworld.name


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •