0

I'm trying to modify file permissions in Linux so that Apache and Django have permission to read and write to the database. The path of my database file is

/var/www/tbg/database/database.sqlite3

I use these commands

chown www-data:www-data /var/www/tbg
chown www-data:www-data /var/www/tbg/database/database.sqlite3

Yet I get the same error (same error as is described here: sqlite3.OperationalError: unable to open database file).

To make sure the permissions are still not there, I can't paste content or create new folders. I can in the the subfolders of /tbg/, though, but not in /tbg/ itself.

Community
  • 1
  • 1
KSHMR
  • 741
  • 1
  • 9
  • 24
  • run `ls -l` on the directory. Lets see the file permissions – secretformula Jun 18 '14 at 19:27
  • I deleted my former comment, I accidentally took a screenshot of the /tbg/ file itself, which already has permissions. This is the permissions for directories inside /www/, including /tbg/: http://i.imgur.com/4JNwqzZ.png – KSHMR Jun 18 '14 at 19:30

1 Answers1

0

I found the answer. I had neglected to change the file permissions of the directories inside /tbg/! With ls -l I was able to figure this out and then I typed

chmod www-data:www-data foldername

to enable apache to read and write to the directories. This must be done for every directory under your project's name (in my case /tbg/) -- and in every subdirectory under every subdirectory!

KSHMR
  • 741
  • 1
  • 9
  • 24