Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Having jumped through several hundred hoops I've finally managed to get Centos 5.8 to mount a VirtualBox shared folder (which is not read-only), which now appears at:

/media/sf_sites

This is a folder on my host machine (Mac OS X 10.8.2) containing sites.

The directory and its subfolders are all owned by user root and group vboxsf

I have added the user apache to the group vboxsf

However httpd doesn't let me use my shared folder as Document root. My vhost is set up as:

DocumentRoot /media/sf_sites/mysite/public

On Apache restart I get this:

Starting httpd: Warning: DocumentRoot [/media/sf_sites/mysite/public] does not exist
                                                           [  OK  ]

And, unsurprisingly, when viewing the site in my browser I get a 403 error. ("You don't have permission to access / on this server.")

Any ideas whether it's possible to make this work?

I want to develop on my Mac but use Linux in VirtualBox as my development server. Is there an alternative way to do this?

share|improve this question
add comment

1 Answer

Create a mount point in your Linux, install sshfs if you don't have it yet.

Do the following in CentOS

sudo su - apache
sshfs root@< your OS X IP >:< web folder path > < mount point >

For example:

  • OS X IP: 192.168.0.10
  • OS X web folder path: /Users/me/webOSX
  • CentOS mount point: /var/www/webLinux

The sshfs command will be: sshfs root@192.168.0.10:/Users/me/webOSX /var/www/webLinux

share|improve this answer
    
This mounts successfully, but same problem: DocumentRoot [/var/www/sites/mysite/public] does not exist –  Ade Nov 4 '12 at 9:48
    
Update: got it to work with user_allow_other set in /etc/fuse.conf and sshfs -o allow_other me@192.168.1.103:/Users/me/Sites /var/www/sites. But Apache throwing "unexpected end of file" errors into error_log. –  Ade Nov 4 '12 at 10:37
    
@Abe, did you sudo su - apache before doing the sshfs mount? –  John Siu Nov 4 '12 at 16:56
    
Yes I did. It seemed to be basically working, but PHP is having problems with file lengths (unexpected end of file errors). Coming to the conclusion that back-end code is better off local on the server! –  Ade Nov 5 '12 at 15:01
add comment

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.