Re: PHP Won't Access Files Outside Web Root (Leopard/MacOS X 10.5)
| From: | Rahul Sitaram Johari | Date: | Thu, 01 Nov 2007 16:38:52 +0000 |
| Subject: | Re: PHP Won't Access Files Outside Web Root (Leopard/MacOS X 10.5) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-263933@lists.php.net to get a copy of this message | ||
On 11/1/07 12:17 PM, "Daniel Brown" <parasane@gmail.com> wrote:
> On 11/1/07, Rahul Sitaram Johari <sleepwalker@rahulsjohari.com> wrote:
>> Well FollowSymLinks was present in my httpd.conf, and it's definitely not
>> the problem. I think the problem is the fact that on in Panther, I was able
>> to specify Apache Web Server to be the User/Group for the share being
>> mounted with -u 70 -g 70 during mount_smbfs.
>>
>> In Leopard I'm not able to do that because they eliminated the -u -g
>> arguments for mount_smbfs - in fact they even eliminated NetInfo Manager so
>> I don't even know Apache's UID & GID.
>>
>> So after mounting the share on the share point, this is what happens:
>> http://www.troyjobs.com/media/smb.gif (It's a
>> screenshot of difference
>> between Panther & Leopard on the same folder showing different User/Group).
>>
>> As you can see files within the mounted share had "www" (Apache) as the user
>> & group and PHP didn't have any problems accessing the files. But in
>> Leopard, "www" (Apache) is not the user/group.
>>
>> I don't know what you have to do in Leopard to mount a share giving it a
>> User/Group of your choice.
>>
>>
>
> Rahul,
>
> The image you showed indicates that there is no user account
> associated with UID 501 on Leopard. That particular UID is, on most
> *nix-based systems, the second-lowest-available default UID for a
> user-created account (starting at 500, unless you specify otherwise).
>
> Try creating an account on Leopard (you may have to do two, unless
> you want to edit /etc/passwd) and then
ls -l the Leopard view
> of the
> share again. You'll see 501 disappear and be replaced by the name
> associated with UID 501. Then just see what the GID associated with
> the group 'admin' is and update that, if need be.
>
> The fix for this could be as simple as su -'ing to
> root and
> chown'ing the directory to the UID/GID of the web server, but I don't
> know how much conflict that will cause for the rest of your system, so
> that's entirely up to you.
Daniel,
You're on the right track. I do realize the UID 501 and how to change that,
I think my biggest two problems right now are:
A) I don't know what's the UID/GID of Apache in Leopard. It used to be 70 in
Panther and I don't know if it's changed or not. They eliminated NetInfo
Manager so I don't even know how to find out.
B) Even if I did find out, I don't know how to apply Apache's UID/GID to
mounted share while mounting. I could possibly go in and manually give the
folder the UID/GID using terminal.
Is there a Terminal way of figuring out the UID/GID of something like admin,
apache etcetera?
PS: I know it's going OT!