Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have an Ubuntu Server (12.04) running on my development machine. It is in a VM. I have succeeded with the task of setting up Apache2, MySQL, and PHP. I can access the server from my host browser by pointing it to the IP. Hurray!

My next task is to set up the filesystem so that I can edit project files on my host computer (Mac OS X 10.7) hit save and view them in my browser through the Linux server.

How I am trying to accomplish this is by sharing a folder on my Mac with the VM, which mounts to /mnt/hgfs/foldername. Then I pointed my virtual host in Apache2 to that folder. chmod the folder to 777 for testing purposes and tried to access the files from my Mac. I get a 403 Forbidden.

How can I set up the VM to share a folder with my Mac so that I don't have to FTP all my files to the server? A thought a had was rsync the /mnt/hgfs/* folder to the public_html

share|improve this question
    
could you do a test and point your apache to a local (unmounted) folder? If this works, then the issue may just be the apache user not having access to your mount. Could you also post a copy of your /etc/fstab –  Rqomey Jun 25 at 15:23
    
@Rqomey Yes, when I point apache to a local (unmounted) folder it work fine! And yes, apache user not having access to your mount, but I can't change owner and group, I have permission denied –  brainforce Jun 27 at 6:54
    
Do chmod 777 from the mac. –  totti Jun 27 at 8:00
    
@totti I do. But why? The permissions already 777. Problems with owner –  brainforce Jun 27 at 8:24
    
@brainforce Could you post the contents of /etc/fstab I suspect you have a mounting option which is limiting your permissions. –  Rqomey Jun 27 at 12:16

1 Answer 1

You need to make sure Apache has permissions all the way down to the public folder. Other then that it should wok fine, I do it all the time.

cmhod o+rx /mnt
chmod o+rx /mnt/hgfs/
chmod o+rx /mnt/hgfs/foldername

apache probable can't get into mnt

share|improve this answer
    
Thanks for review! I has permissions 777 for all folder, but error is still exist. I think problem is that owner of current dir and all files in it is a 502, and the group of dialout. And I cant execute chown command, get an error: Operation not permitted. –  brainforce Jun 26 at 21:30
    
what is the permissions for every folder in the path? –  coteyr Jun 27 at 0:38
    
Permissions are 777, owner - 502 (I think it's my current user id from mac), group - dialout. And I can change only permisstions, not owner or group –  brainforce Jun 27 at 6:50
    
does user 502 exist locally? is apache in the dialout group? As far as apache can tell there's no different between a mount and a local folder. It must be a permission issue. Is any of it a symlink? –  coteyr Jun 27 at 7:43
1  
sudo adduser mbp -u 502 should do it. –  coteyr Jun 27 at 17:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.