* It would provide the long outstanding correct bugfix for several security flaws in ruby (without breaking rails support [1,2,3]).
* It would also decrease the memory requirements on the server itself.
Here is my (old) configuration of mod_rails with standard ruby:
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.0.1/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.1
PassengerRuby /usr/bin/ruby1.8
RailsEnv production
RailsMaxPoolSize 10
RailsPoolIdleTime 120
So after installing Ruby Enterprise Edition for Ubuntu, I only had to change one line:
#PassengerRuby /usr/bin/ruby1.8
PassengerRuby /opt/ruby-enterprise-1.8.6-20080624/bin/ruby
I restarted apache (just to be sure).
The result was not what I actually expected:
A quick check on the FAQ's on Pushion#s homepage revealed some hints - but I had already done that.
The actual problem
The problem wasn't the ruby enterprise edition (although only err shown the different behaviour), the source of the problem is the sqlite3-ruby gem itself. It doesn't contain read-rights on some files (oh dear maintainer!).
root@server:/opt/ruby-enterprise-1.8.6-20080624/lib/ruby/gems/1.8/gems# cd sqlite3-ruby-1.2.2/
root@server:/opt/ruby-enterprise-1.8.6-20080624/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.2# find . -perm 0662 -exec ls -l {} \;
-rw-rw--w- 1 root root 3738 Jul 1 00:54 ./lib/sqlite3/translator.rb
-rw-rw--w- 1 root root 24774 Jul 1 00:54 ./lib/sqlite3/database.rb
-rw-rw--w- 1 root root 3174 Jul 1 00:54 ./doc/faq/faq.rb
-rw-rw--w- 1 root root 10744 Jul 1 00:54 ./ext/sqlite3_api/sqlite3_api.i
-rw-rw--w- 1 root root 457 Jul 1 00:54 ./ext/sqlite3_api/extconf.rb
-rw-rw--w- 1 root root 33308 Jul 1 00:54 ./test/tc_integration.rb
-rw-rw--w- 1 root root 541 Jul 1 00:54 ./test/tc_errors.rb
The fix
Just add read-permissions to the files:
root@server:/opt/ruby-enterprise-1.8.6-20080624/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.2# find . -perm 0662 -exec chmod 664 {} \;
Everything is now up-and-running smoothly for 4 days now - thanks to mod_rails and Ruby Enterprise Edition from Phusion.
No comments:
Post a Comment