sqlite3/activer record permissions problem (no ror)

D

Doug Jolley

I'm using Ruby and ActiveRecord in a web environment (no ror). The
database is sqlite3. sqlite3-ruby is installed. I can add records to
the database from Ruby scripts using ActiveRecord just fine provided
that I am root. However, as any other user it bombs out with the error
message shown below. If this is going to work for me, I need to have
the user 'Apache' be able to add records to the database. Can anyone
please tell me what the problem is and how I might fix it. Thanks for
any input. Here is the relevant part of the error message:

/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:150:in
`log': SQLite3::SQLException: SQL logic error or missing database:
INSERT INTO news
 
P

Patrick Doyle

[Note: parts of this message were removed to make it a legal post.]

My guess is that the sqlite database is owned by root (or by anybody other
than the user 'Apache') and does not have world write privileges. Look at
the permissions on the database file.

--wpd
 
D

Doug Jolley

My guess is that the sqlite database is owned by root (or by anybody
other than the user 'Apache') and does not have world write privileges.
Look at the permissions on the database file.

Unfortunately, the database is owned by 'apache' and assigned to the
group 'apache'. In addition, at the moment the database has world write
permissions. I am hopeful that after I get this problem resolved, the
write permissions can be restricted to a single user, presumably
'apache'. Thanks for your input. I should have mentioned those facts
in my post.

... doug
 
D

Doug Jolley

FWIW, I just got this working by making the directory that contains the
database owned by 'apache' and and assigned to the 'apache' group.
Thanks for the help.

... doug
 
J

Jeremy Hinegardner

FWIW, I just got this working by making the directory that contains the
database owned by 'apache' and and assigned to the 'apache' group.
Thanks for the help.

... doug

That would be because sqlite needs write permissions to the directory so it may
create the .journal file.

enjoy,

-jeremy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top