Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just upgraded to OS X 10.8 Mountain Lion to find that my web server setup was ruined by the upgrade. I managed to get PHP and Apache back up and running, but I still do not have my old setup from Lion up and running. For my old setup, I used a shady technique in order to make Apache work with Dropbox; in /Users/Andy/Sites/project1, I had a symbolic link, which pointed to /Users/Andy/Dropbox/MyFolder/dev/project1. I found that I could not direct my virtual host to Dropbox directly (probably something with permissions that didn't work). However, it worked perfectly with a symbolic link. So in this way, I could store my projects in Dropbox and use my local Apache server.

After setting Apache up to work with my Sites folder, I can now point my virtual hosts to sub folders in this directory and this works fine. However, when I try to point it to my symbolic link, I get a 403 Forbidden error. I really want to use Dropbox for my small projects where SVN or Git is overkill. Here is part of my configuration:

/etc/hosts:

127.0.0.1 test.dev

/etc/apache2/extra/httpd-vhosts.conf:

<VirtualHost *:80>
ServerName test.dev
DocumentRoot "/Users/Andy/Sites/project1"

<Directory "/Users/Andy/Sites/project1">
    DirectoryIndex index.php
    Options FollowSymLinks Indexes
    AllowOverride All
    Order deny,allow
    allow from All
</Directory>
</VirtualHost>

My symbolic link:

lrwxr-xr-x    1 Andy  staff     59 Sep 30 12:01 project1 -> /Users/Andy/Dropbox/Myfolder/dev/project1/

/etc/apache2/users/Andy.conf (this seems to work fine since I can serve files from the Sites folder):

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

I also get the same error if I don't use my virtual host, i.e. localhost/~Andy/project1.

Perhaps there is a better setup that does not involve symbolic links and still allows me to use Dropbox, and then I am very interested to know. Otherwise, does anyone have any idea how to solve this? I guess it's all about permissions, so which permissions should my ~/Dropbox/MyFolder/dev/project1 folder have? I am no good at permissions, but I tried to use chmod a+rw project1 without any luck.

Thanks a lot in advance!

share|improve this question
up vote 0 down vote accepted

I solved it by pointing my directory in /etc/apache2/users/Andy.conf to /Users/Andy/Dropbox/MyFolder/dev like this:

<Directory "/Users/Andy/Dropbox/My own folder/dev">
    Options Indexes MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

Then I updated my virtual host to point to my project's folder like this:

<VirtualHost *:80>
ServerName test.dev
DocumentRoot "/Users/Andy/Dropbox/MyFolder/dev/project1"

<Directory "/Users/Andy/Dropbox/MyFolder/dev/project1">
    DirectoryIndex index.php
    Options FollowSymLinks Indexes
    AllowOverride All
    Order deny,allow
    allow from All
</Directory>
</VirtualHost>

I could have sworn that I couldn't get this to work on OS X Lion, but perhaps I took a slightly different approach back then. Nevertheless, it works for me now on OS X Mountain Lion.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .