Server Fault is a question and answer site for system and network administrators. 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 have changed my Document Root in the MAMP settings to a folder in my Dropbox so I can easily sync my files between computers. This was fine until I started to using relative file paths, the URL was not found because it was looking in the root rather than the subdirectory that held the site files.

I've tried to set up a virtual host to solve the problem, but it seems that having set my own MAMP document root to Dropbox is not letting this happen. I added this line to the bottom of my hosts file oip.local and I have this at the end of my Apache httd.conf:

NameVirtualHost *

<VirtualHost *:80>    
    DocumentRoot "/Volumes/OSX/Lara/Dropbox/Sites"    
    ServerName localhost 

<VirtualHost *:80>    
    DocumentRoot "/Volumes/OSX/Lara/Dropbox/Sites/onlyinpgh"    
    ServerName oip.local 

If I go to settings and change the document root back to /Applications/MAMP/htdocs, the oip.local gets to the proper home page, but (as expected) everything breaks as soon as I point to a file in the root because it's in Dropbox, not htdocs. I've been restarting MAMP, clearing Cache/Cookies, restarting browsers throughout the process. I also have the Apache port set the the default, 80.

Any idea how to avoid this? Is there a better way than Dropbox to sync my site files across computers? Thanks in advance.

share|improve this question

The argument must be the same as the NameVirtualHost argument, i.e. you need to use:

NameVirtualHost *:80

Also, you could consider using Selective Sync to choose the folder you want to sync with the Dropbox app.

share|improve this answer

Your Answer


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.