Dropbox You don't have permission to access / on this server.

Update 24-July-2012 To avoid missing hidden files (e.g. .htaccess) use rsync rather than cp to copy files. E.g. rsync -ravz /src/folder/ /dest/folder/ --------------- Original Notes --------------- We added a new Ubuntu 10.04 server to our Dropbox account and I'm not sure of the exact sequence, but some time soon after that every server, including linked development server all reported "You don't have permission to access / on this server.". Obviously a permissions issue, and obviously due to Dropbox as it happened on all linked servers. Checking permissions all seemed ok, but it wasn't immediately obvious that we had at some stage during setup months ago modified the group of all the files to www-data to allow apache to read-all and write-some files/directories. In the end this was a fairly easy fix, made a bit more tricky given we had stuffed around with all permissions to try and get a quick fix and were running Drupal which requires certain directories to be read/write to support modules saving files. So, here is how we fixed it. (It is possible this could also be done by adding www-data to the $USER group, but this might have security implications.) 1) Apply the apache www-data group to all files. sudo chown -R $USER:www-data $HOME/Dropbox/ That may have been all that was required, however, if you have already played around with permission recursively like we did, then you may wish to reapply the permissions as well. 2) Remove write permission, add read and execute permissions to all files in the group. sudo chmod g-w+rx -R $HOME/Dropbox/ If you are running a simple web server that may be all you required, however, if you are running Drupal, then you may need to apply some specific write permissions. See Drupal documentation for details. 3) This is what we applied for Drupal. Owner and Group given write to files directory. All remove write to settings.php All remove write to default directory All remove write to CHANGELOG.txt sudo chmod og+rwx -R $HOME/Dropbox/yourwebsite/public_html/sites/default/files sudo chmod a-w $HOME/Dropbox/yourwebsite/public_html/sites/default/settings.php sudo chmod a-w $HOME/Dropbox/yourwebsite/public_html/sites/default sudo chmod a-r $HOME/Dropbox/yourwebsite/public_html/CHANGELOG.txt A few notes about our research and testing. We are not sure exactly what lead to the group permissions be reset by Dropbox, but it seems likely that it occurred as a result of adding a new linked server. Reference 1 below indicated the way to fix the problem and gave some indication that others are seeing this issue, but did not provide much insight into why it is occurring. Reference 2 indicated that windows might somehow be involved in 'flattening' file permissions, but in our testing we could not reproduce these conditions. Reference 3 shows how to recursively chmod just directories or just files. This will recursively search your directory tree (starting at dir ‘dot’) and chmod all with read and execute permissions to diretories only. Note to do a directory listing you need execute permissions on directories. sudo find . -type d -exec chmod a+rx {} \; Similarly, the following will chmod u+rw on all files only (and ignore the directories). sudo find . -type f -exec chmod u+rw {} \; References: 1) http://forums.dropbox.com/topic.php?id=37563 2) http://ubuntuincident.wordpress.com/2011/05/08/setting-file-permissions-in-your-dropbox-folder-recursively/ 3) http://movabletripe.com/archive/recursively-chmod-directories-only/

Comments

Popular posts from this blog

PHP timezones explained

iPhone Internet Tethering settings