I'm trying to set up the private files directory and I'm getting the following error.
The backup file could not be saved to 'private://backup_migrate/' because the directory could not be created or cannot be written to. Please make sure your private files directory is writable by the web server.
Could someone help correct my misstep? I've scoured scads of pages of documentation, and oddly I don't seem to be able to find a reliable path to a solution. Lots of conflicting info and lots of missing details.
Here's my setup:
- bitnami drupal image (centos)
- path to Drupal /root/apps/drupal/htdocs
- I've connected as root via ssh
Here are the exact steps I've followed, and which best reflect my understanding so far of what I should do:
# cd /root/apps/drupal/
to go to directory that contains the web root directory# mkdir private-files
# drush dl file_permissions --destination=~/.drush
to download the contributed file_permissions utility, which says it handles all necessary permissions changes# nano sites/default/settings.php
to tell Drupal where to find the directory, set$settings['file_private_path'] = '/root/apps/drupal/private-files';
# drush cr
to clear Drupal and Drush caches# drush fp
to run the file_permissions utility; it responds:Your httpd user: daemon [status]
Your httpd group: daemon [status]
You will be prompted for admin password to be able to change [warning]
permissions withsudo
command.
Security warning: Couldn't write .htaccess file. Please create a [error]
.htaccess file inyour private:// directory which contains the
following lines: <pre><code># Deny all requests from Apache 2.4+.
<IfModule mod_authz_core.c>
Require all denied
</IfModule># Deny all requests from Apache 2.0-2.2.
<IfModule !mod_authz_core.c>
Deny from all
</IfModule>
# Turn off all options we don't need.
Options -Indexes -ExecCGI -Includes -MultiViews# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
<Files*>
# Override the handler again if we're run later in the evaluation list.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
</Files>
# If we know how to do it safely, disable the PHP engine entirely.
<IfModule mod_php5.c>
php_flag engine off
</IfModule></code></pre># drush cr
to clear Drupal and Drush caches# ls -al
to see permissions; it shows:total 8628
drwxr-xr-x 7 root root 134 Jul 23 12:04 .
drwxr-xr-x 5 root root 53 Jun 7 13:52 ..
lrwxrwxrwx 1 root root 14 Jun 7 13:55 .bitnamimeta -> ../../var/meta
-r-xr--r-- 1 root root 8826689 Jun 7 13:31 bnconfig
drwxr-xr-x 4 root root 146 Jun 7 13:51 conf
drwxr-xr-x 12 root root 4096 Jun 7 13:51 drush
drwxr-x--- 9 root daemon 4096 Jul 18 13:46 htdocs
drwxr-xr-x 2 root root 25 Jun 7 13:51 licenses
drwxrwsr-x 2 daemon daemon 23 Jul 23 13:45 private-files
lrwxrwxrwx 1 root root 33 Jun 7 13:54 updateip -> /opt/bitnami/apps/drupal/bnconfig# ls -al private-files/
to see permissions; it shows:total 4
drwxrwsr-x 2 daemon daemon 23 Jul 23 13:45 .
drwxr-xr-x 7 root root 134 Jul 23 12:04 ..
-rw-r--r-- 1 root daemon 687 Jul 23 13:47 .htaccess
Needless to say, pretty frustrating since I've spent at least 4 hrs on what I imagine must be simple for someone already familiar with all the components.
Since I am new to servers as well as to Drupal, please break out actual steps vs merely invoking (vague-to-me) concepts such as 'change user group' or the like.