Sunday, 30 March 2014

Drupal Backup and Migrate private folder settings

So, I'm just getting started with Drupal and just installed the Backup and Migrate module. When I tried a backup to a folder on the same server it came up with an error. It was basically saying that this folder was not private and anyone can access it.

Thought I'd take a quick look into it. Turns out that the folder in question - sites/default/files/private/backup_migrate/manual/
can be read by anyone, therefore files are not safe.

So, how do you make it 'private'. Well, a good test is to try and navigate to the file:
sites/default/files/private/backup_migrate/manual/test.txt
which automatically gets made. I typed it into a browser and it loaded up. Simple.

So, to limit access depends on you hosting provider. I'm with Daily.co.uk, and they suggest using .htaccess files. I found this nice article on the subject, worth reading through properly.

I found that this command at the top of the .htaccess file (which was already in the folder) solved the problem:

AllowOverride All

I figure it's telling the Apache server to override all options.

No comments:

Post a Comment