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.

I'm trying to serve web pages from my Dropbox folder (at ~/Dropbox/Projects/MySite/) on Lion 1.7.2 using Apache. But all I get are 403 Forbidden errors.

I'm positive this has something to do with the permissions in that folder, because I can change the virtualhost directory to a page I've created at the command line with sudo and it works fine.

The pages that do work are owned by root:wheel. I've tried changing just the MySite folder to root:wheel, but to no avail. I'm worried that if I keep changing permissions up the directory tree I could mess something up.

How should I go about getting sites served from Dropbox?

share|improve this question
    
I spent an hour on the phone with a server admin friend and we were unable to fully resolve it. As a hack, we changed Apache's running user and group to match mine, so it has access to everything on my machine. Probably not a problem since this isn't a production server, but it would be nice to figure out how to let the _www user read my Dropbox folder. –  Jordan Roher Dec 28 '11 at 22:11
add comment

2 Answers

The solution I found to this was to move the existing Sites folder aside...

sudo mv ~/Sites ~/Sites.old

Then create a symlink from the Dropbox folder with my files to Sites..

ln -s ~/Dropbox/Projects/MySite Sites

And lastly edit my USERNAME.conf file to allow Apache to follow the sym link. So, using whatever editor you are comfortable with, edit /etc/apache2/users/USERNAME.conf to change...

<Directory "/Users/USERNAME/Sites/">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

To read...

<Directory "/Users/USERNAME/Sites/">
    Options Indexes MultiViews +FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

Then restart Apache...

sudo apachectl restart

You should now be able to edit your files in Dropbox and have them served up using Apache.

Be aware, that using FollowSymLinks is a potential security risk, so shouldn't be used in a live/production environment.

share|improve this answer
add comment

Because Apache runs as a separate user, its not allowed to just stumble into your folders. You might want to read up on UNIX file permissions: http://en.wikipedia.org/wiki/Chmod but in this case the folder is probably either 755 or 775 which would be either Full for user, Read and Execute for Group and Others, or Full for User and Group and Read/Execute for others. Because Apache is a different user and you do not share a group in common, the folder would likely need to be 777 so that it can use it. This a bit of a messy fix and it might be easier for you to just symlink a folder that it can access into your Dropbox, maybe your ~/Sites folder?

share|improve this answer
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.