====== Setup upgraded Ruby server ====== =====Hardware Details===== OS - CENTOS 6.5 64-bit =====Instructions===== ===== General Server setup ==== Please follow the instructions from the link below, except for ruby, rubygems, passenger and capistrano. https://wiki.exphosted.com/doku.php/setup_an_app_server If the same server is being used as db please install mysql and solr. https://wiki.exphosted.com/doku.php/setup_db_server https://wiki.exphosted.com/doku.php/qastageandproductiondeployment#installing_solr_tomcat_on_search_server If the same server is being used for Chat please install juggernaut and node. https://wiki.exphosted.com/doku.php/setup_other_roles#chat_role Install memcache if it is not shared with any other server. https://wiki.exphosted.com/doku.php/setup_other_roles#memcached_role ==== Install ruby 1.9.3 ==== == Remove previous verions of ruby == First , remove any existing ruby versions. On our app servers REE1.8.7 could have been installed. So, please remove them. If ruby was installed through the instructions mentioned above. All, you need to do is sudo mv /opt/ruby-enterprise-1.8.7-2011.03 ruby-enterprise-1.8.7-2011.03_removed Otherwise, please remove all the executables of ruby, gem, rake, irb, passenger and etc.. == Install ruby 1.9.3 === Make yourself root su root #update or install libyaml yum insyall libyaml #Install ruby cd /opt wget http://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p550.tar.gz tar xzvf ruby-1.9.3-p550.tar.gz cd ruby-1.9.3-p550 ./configure --prefix=/opt/ruby-1.9.3 make make install echo 'pathmunge /opt/ruby-1.9.3/bin' >> /etc/profile.d/crossbow.sh logout Now login and verify if ruby -v returns the correct version. == Update rubygems == gem update --system 1.8.29 === Install passenger === gem install passenger -v=4.0.44 Make changes to the apache config file. (Config file remains same as the one used for ruby 1.8.7 REE's passenger 3 but the following lines need to be modified. #LoadModule passenger_module /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/gems/1.8/gems/passenger-3.0.9/ext/apache2/mod_passenger.so LoadModule passenger_module /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/passenger-4.0.44/buildout/apache2/mod_passenger.so LoadModule upload_progress_module modules/mod_upload_progress.so PassengerRoot /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/passenger-4.0.44 PassengerDefaultRuby /opt/ruby-1.9.3/bin/ruby #RailsFrameworkSpawnerIdleTime 0 PassengerMaxPreloaderIdleTime 0 #RailsAppSpawnerIdleTime 0 PassengerMaxPreloaderIdleTime 0 ### End Passenger tuning## #RailsAutoDetect off === Update the gem versions of the components === If the following gems are already installed, please uinstall them using "gem uninstall " command and reinstall. gem install bundler -v=1.6.2 gem install rack -v "1.5.2" gem install god -v=0.13.3 gem install capistrano -v=2.15.4 gem install capistrano-ext -v=1.2.1 === Update ruby path as needed === * For God - Change ruby path in /deplo/systasks/god.sh and /etc/init.d/god * For Capistrano - Change ruby path in /home/expdev01/crossbow/config/deploy.rb and /home/expdev01/crossbow/runcap.sh === Install needed gems before hand === == Nokogiri == yum install libxml2 libxml2-devel (2.9.0-4) bundle config build.nokogiri --use-system-libraries gem install nokogiri -- --use-system-libraries -v='1.6.3.1' == RedCloth == bundle config build.RedCloth --with-cflags=-w gem install RedCloth -v='4.2.9' === Database config file change === Change /deploy/crossbow/shared/config/database.yml "adapter" to mysql2 in all the needed stanzas. === God configuration changes === Change /deploy/crossbow/shared/config/god/generic_monitoring.god to update the bundle paths to /opt/ruby-1.9.3/bin/bundle from /usr/local/bin/bundle ==== Capistrano ==== Please update the capistrano config files as needed. Refer the link below for more information. https://wiki.exphosted.com/doku.php/qastageandproductiondeployment#deployment_steps ==== Run db:seed ==== If you are using a fresh database for the current app setup, run the following task in the app directory bundle exec rake db:seed RAILS_ENV=