2

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..

3 Answers 3

6

Execute chown www-data:www-data directory on the directory you want apache to be able to write to.

Sign up to request clarification or add additional context in comments.

11 Comments

yeah but it is saying: invalid group www-data. do i have to create it first?
see my last comment above, but still unable to open database file.
cat /etc/group | grep www-data type this to see whether group exists.
oh yeah, the group exists. is it a group or a user? because it is on users list.
it is a group. try this in your project root directory . sudo chown -Rf www-data *
|
0

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>

2 Comments

it says, invalid group www-data. :(. do i have to create it first?
okay i did, it was not chgrp but chown, because www-data is not a group, right? but still it is saying, unable to open database file..
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.