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 -- Posted via http://www.ruby-forum.com/.
On Jun 10, 11:06 pm, Mk 27 <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> 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> -MK > -- > Posted viahttp://www.ruby-forum.com/.
Frederick Cheung wrote:> On Jun 10, 11:06�pm, Mk 27 <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> 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 ? > > FredHere''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 / </VirtualHost> Apache runs as "apache". _MK -- Posted via http://www.ruby-forum.com/.
On Wed, Jun 10, 2009 at 7:49 PM, Mk 27<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Frederick Cheung wrote: >> On Jun 10, 11:06�pm, Mk 27 <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> 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 / > </VirtualHost> > > 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
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#PassengerUserSwitchingThanks Rick. I added this to httpd.conf PassengerDefaultUser root and presto. _MK -- Posted via http://www.ruby-forum.com/.
On Thu, Jun 11, 2009 at 12:11 AM, Mk 27<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > 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.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