Cannot open database under Passenger

After switching to passenger from WEBbrick I keep getting “attempt to
write to read-only database”, so I chown’d the sqlite file apache.apache
and chmod’d 666, now I get “unable to open database file”?

-MK

On Jun 10, 11:06 pm, Mk 27 removed_[email protected] wrote:

After switching to passenger from WEBbrick I keep getting “attempt to
write to read-only database”, so I chown’d the sqlite file apache.apache
and chmod’d 666, now I get “unable to open database file”?

What user is passenger set to run your ruby code as ?

Fred

Frederick C. wrote:

On Jun 10, 11:06�pm, Mk 27 [email protected] wrote:

After switching to passenger from WEBbrick I keep getting “attempt to
write to read-only database”, so I chown’d the sqlite file apache.apache
and chmod’d 666, now I get “unable to open database file”?

What user is passenger set to run your ruby code as ?

Fred

Here’s the stuff I put in httpd.conf:

LoadModule passenger_module
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2
PassengerRuby /usr/local/bin/ruby

NameVirtualHost *:80

<VirtualHost *:80>
ServerName dev.docsearch.net
DocumentRoot “/var/www/html/docsearch/public/”
RailsEnv development
Alias /filesystem /

Apache runs as “apache”.

_MK

Rick Denatale wrote:

By default though the passenger process for a rails app tries to run
as the user which owns conf/environment.rb unless configured otherwise
it runs as the user nobody unless configured otherwise.

http://www.modrails.com/documentation/Users%20guide.html#user_switching
http://www.modrails.com/documentation/Users%20guide.html#PassengerUserSwitching

Thanks Rick. I added this to httpd.conf

PassengerDefaultUser root

and presto.

_MK

On Wed, Jun 10, 2009 at 7:49 PM, Mk 27[email protected]
wrote:

  ServerName dev.docsearch.net
  DocumentRoot “/var/www/html/docsearch/public/”
    RailsEnv development
    Alias /filesystem /

Apache runs as “apache”.

By default though the passenger process for a rails app tries to run
as the user which owns conf/environment.rb unless configured otherwise
it runs as the user nobody unless configured otherwise.

http://www.modrails.com/documentation/Users%20guide.html#user_switching
http://www.modrails.com/documentation/Users%20guide.html#PassengerUserSwitching


Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

On Thu, Jun 11, 2009 at 12:11 AM, Mk
27[email protected] wrote:

Thanks Rick. I added this to httpd.conf

PassengerDefaultUser root

and presto.

I think it would be better to use a user with less privilege than root.


Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale