[SAMBA] Setting permissions

euthymos

Registered
Dear ones,

I've mounted a Samba volume, and I've set Apache's document root to a folder located into this volume.

When I try to access http://localhost/ I get the following message:

Forbidden
You don't have permission to access / on this server.

Maybe this is a problem of permissions, so that Apache can't access the volume... What can I do?
 
You are trying to set your apache root to a remote file share? Can I ask why?

It could be that the share is only mounted so your user has access to it, in that case apache, which is probably owned by another user, can't access it.

To verify this try typing opening a terminal, cd to the mounted samba share (/Volumes/<share name>) and try doing an ls -l

See who the owner is, and what the permissions are for the share mount point. When I mount a share that I have full access to, the mount point is owned by me and only the owner (my user) has read write and execute access on it. No other levels (group and other) have any privileges.

In this case you would have to do a chmod to give others access to the share.
 
You are trying to set your apache root to a remote file share? Can I ask why?
We are a small workgroup and we're developing a website. We work together on the same project (which is stored in a remote file share, whose machine is not physically accessible to us and not configurable).


It could be that the share is only mounted so your user has access to it, in that case apache, which is probably owned by another user, can't access it.
Yes, I had the same idea.


To verify this try typing opening a terminal, cd to the mounted samba share (/Volumes/<share name>) and try doing an ls -l
The owner is me.


In this case you would have to do a chmod to give others access to the share.
Can you help me doing so?


Thanks.
 
Keep in mind that I have never actually done this, and I don't have access to a Mac right now. I don't think it will modify the actual files in any way. I THINK... It would be smart to try it out first on another share that has unimportant data. Maybe ask a co-worker to add a new windows share for testing and put some dummy files in it.

Open a terminal and type the following commands:

cd /Volumes

ls -l

Take note of the share's mount point.

sudo chmod -R o+r <name of the mount point>

basically this command should recursively add the read permission for all other users. You will remain to be the only user who can write but apache should then be able to read the share.

If it works, you might have to do it every time you mount the share.
 
Back
Top