Reputation: 37866
My sqlite db file is this: unable to open database file
i chowned all folders until my dbfile to root. but i am still getting this error. but i remember that while creating my django project on server, i created a superuser, and now if i do ls -l
i see that the user is that superuser. how is it possible to tell apache that this superuser should have that right to write/read the db file? or how to solve the problem, i am not apache/linux guru..
Upvotes: 2
Views: 3539
Reputation: 1
You can find write group and www user and change permissions. Say: cat /etc/passwd - for find right user, It may be apache or http or www. And say to terminal: cat /etc/group -for find right group. In my system group=apache, user = apache.
Upvotes: 0
Reputation: 3535
Execute chown www-data:www-data directory
on the directory you want apache to be able to write to.
Upvotes: 6
Reputation: 76
You should be able to just leave the file as owned by the super user and just change the group so that apache can read/write it as well.
Change the group for the sqlite file and the containing directory. Try this:
cd <directory with sqlite file>
sudo chgrp www-data . <sqlitefile>
Upvotes: 0